You are not logged in.
Dear All,
I am programming in Python under Ubuntu 10.04 and this is a small code to test the LED of our favorite device
If you are interested, please don't hesitate to contact me for discussion.
I am looking for a scheme using timer NE555 or other IC to convert voltage (10 to 500 mV) for frequency to obtain precise measurements...
#!/usr/bin/env python
import serial, time
try:
muChameleon = serial.Serial('/dev/ttyUSB0',9600)
except:
muChameleon = None
print "Failed to connect on /dev/ttyUSB0"
def send(command):
muChameleon.flushInput() # Discard input buffer
muChameleon.write(command + '\n')
print muChameleon.inWaiting() # For debugging
time.sleep(0.1)
print muChameleon.inWaiting() # For debugging
if muChameleon.inWaiting() != 0: # Reply into the buffer
print muChameleon.readline()
#muChameleon.write('led on\n')
#muChameleon.write('id\n')
#List = []
#Test = ''
#print
#while Test != '\n':
# Test = muChameleon.read()
# List.append(Test)
#print str(''.join(List))
#muChameleon.write('led on\n')
if __name__ == '__main__' and muChameleon:
while 1:
send(raw_input('Command> '))
Offline