1
USB Infrared Toy / Re: FAI2 error after firmware update, IR Toy is brand new
absolutely.. but I need to get my hand on a windows box for that. will get back whne more testing has been done
Open Source Hardware
This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.
#!/usr/bin/python
import serial,time
# to enable the print() function
#from __future__ import print_function
IsUsbIrToyUsed=True
COMPort='/dev/ttyUSB0' # Change this if needed :)
mySer=serial.Serial(COMPort, 9600, timeout=2)
channelUp = 'x00x29x00x29x00x29x00x28x00x52x00x29x00x2ax00x52x00x2ax00x29x00x29x00x28x00x53x00x29x00x29x00x52x00x52x00x29x00x29x00x28x00x29xffxff'
channelDown='x00x27x00x29x00x29x00x2bx00x51x00x2ax00x28x00x54x00x28x00x29x00x28x00x2bx00x51x00x2ax00x28x00x54x00x52x00x29x00x29x00x53x00x27x10x5ex00x27x00x2bx00x28x00x29x00x51x00x2bx00x27x00x54x00x29x00x29x00x28x00x2ax00x51x00x2ax00x28x00x54x00x50x00x2bx00x28x00x54x00x29xffxff'
# run this on the given string to make it appropriate for emission - maybe we
# can get good output directly? that whole function is probably ugly anyway
# s/0x0 /0x00 /g
# s/0x/\x/g
# s/ //g
def readCode():
global mySer
print "reading code"
data = mySer.readline()
for char in data:
print hex(ord(char)),
def sendCode(request):
global mySer
print "sending code"
mySer.write('x03')
mySer.write(request)
def blinkLED():
mySer.write('x12')
time.sleep(.2)
mySer.write('x13')
try:
if(IsUsbIrToyUsed):
# enter sampling mode
mySer.write('s')
if 1:
blinkLED()
sendCode(channelUp)
else:
while 1:
readCode()
mySer.flushInput()
finally:
mySer.close()