Hi All,

I tried to manage to get the code below started but it's doesn't work. I'm 
using the adafruit libary for using the GPIO functions off the beagle bord. 
Any one any idea wy the code isn't working?? I try to reach a HX711 adc 
chip over the SPI bus.

import Adafruit_BBIO.GPIO as GPIO
import time

DAT = "P9_20"
CLK = "P9_21"
GPIO.setwarnings(False)
GPIO.setup(CLK, GPIO.OUT)

def test():
    i=0
    GPIO.setup(DAT, GPIO.OUT)
    GPIO.output(DAT,1)
    GPIO.output(CLK,0)
    GPIO.setup(DAT, GPIO.IN)

    while GPIO.input(DAT) == 1:
        num=0
        i=0
        for i in range(24):
            GPIO.output(CLK,1)
            num=num<<1

            GPIO.output(CLK,0)

            if GPIO.input(DAT) == 0:
                num=num+1

        GPIO.output(CLK,1)
        num=num^0x800000
        GPIO.output(CLK,0)
        print("test :", num)
while True:
    test()

Regards,

Jelle

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/f50a6787-a547-462e-9d95-7c934c56aa11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to