Just a test

Post test messages here

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
DMart
 
Posts: 5
Joined: Mon Mar 18, 2013 11:44 pm

Just a test

Post by DMart »

just testing this out. [adafruits-raspberry-pi-lesson-11][/http://learn.adafruit.com/adafruits-ras ... g/overview] to see if it shows up like expected...

DMart
 
Posts: 5
Joined: Mon Mar 18, 2013 11:44 pm

Re: Just a test

Post by DMart »


DMart
 
Posts: 5
Joined: Mon Mar 18, 2013 11:44 pm

Re: Just a test

Post by DMart »

Code: Select all

import os
import glob
import time

os.system('sudo modprobe w1-gpio')
os.system('sudo modprobe w1-therm')

base_dir = '/sys/bus/w1/devices/'
device_folder = glob.glob(base_dir + '28*')[0]
device_file = device_folder + '/w1_slave'

def read_temp_raw():
    f = open(device_file, 'r')
    lines = f.readlines()
    f.close()
    #lines = ['7b 01 4b 46 7f ff 05 10 ld : crc=ld YES', '7b 01 4b 46 7f ff 05 10 ld t=23456']    
    return lines

def read_temp():
    lines = read_temp_raw()
    while lines[0].strip()[-3:] != 'YES':
        print(lines)
        time.sleep(0.2)
        lines = read_temp_raw()
    print(lines)   
    equals_pos = lines[1].find('t=')
    if equals_pos != -1:
        temp_string = lines[1][equals_pos+2:]
        temp_c = float(temp_string) / 1000.0
        temp_f = temp_c * 9.0 / 5.0 + 32.0
        return temp_f
    
def run_temp():
    while True:
        print(read_temp())
        time.sleep(1)

#run_temp()

eddiehern8
 
Posts: 3
Joined: Sun Apr 21, 2013 6:37 pm

8-channel Bi-directional Level shifter

Post by eddiehern8 »

I just got an 8-channel Bi-directional Level shifter and was wondering how to connect it. I'm not sure if I have to connect both the Vcca to 3.3 volts and Vccb to 5 volts at all times in order to convert my INPUT signals of 5V to 3.3V.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Just a test

Post by adafruit_support_rick »

@eddie - this isn't the right forum for asking a question. I only found your post because I was checking for spam. In the future, you should post in one of the product support forums.

To answer your question, you have to connect have 3.3V and 5V connected at all times. You also need to connect OE to Vcca to enable the chip.

Locked
Please be positive and constructive with your questions and comments.

Return to “Test Message Forum (closed)”