This shows you the differences between two versions of the page.
— |
wiki:projects:python:ezusb:knightrider [2006/06/16 11:50] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== knightrider ====== | ||
+ | a knightrider example... | ||
+ | ===== firmware ===== | ||
+ | * {{:wiki:projects:python:ezusb:iomap.hex.zip|iomap.hex.zip}} | ||
+ | |||
+ | ===== source ===== | ||
+ | <code python> | ||
+ | #!/usr/bin/python | ||
+ | |||
+ | from ezusb import EZUSB | ||
+ | |||
+ | ezusb=EZUSB(0x0547,0x2131) | ||
+ | ezusb.downloadFW('iomap.hex') | ||
+ | |||
+ | import time as time | ||
+ | |||
+ | time.sleep(0.1) | ||
+ | |||
+ | while 1: | ||
+ | cValue=1 | ||
+ | while cValue<256: | ||
+ | time.sleep(0.5) | ||
+ | ezusb.writeRAM(0x1b40,cValue) | ||
+ | cValue=cValue<<1 | ||
+ | |||
+ | cValue=128 | ||
+ | while cValue>0: | ||
+ | time.sleep(0.5) | ||
+ | ezusb.writeRAM(0x1b40,cValue) | ||
+ | cValue=cValue>>1 | ||
+ | </code> |