mirror of
https://github.com/brmlab/ledbar.git
synced 2025-06-10 05:44:01 +02:00
Fixed synchronization bugs in Python version
This commit is contained in:
parent
21d9a3d4a4
commit
b734027e05
2 changed files with 3 additions and 0 deletions
|
@ -64,6 +64,7 @@ def main():
|
||||||
b = read_byte()
|
b = read_byte()
|
||||||
pygame.draw.rect(screen, [r, g, b], [pixel_width*i, 0, pixel_width-offset, pixel_width-offset])
|
pygame.draw.rect(screen, [r, g, b], [pixel_width*i, 0, pixel_width-offset, pixel_width-offset])
|
||||||
write_byte(r); write_byte(g); write_byte(b)
|
write_byte(r); write_byte(g); write_byte(b)
|
||||||
|
sys.stdout.flush()
|
||||||
pygame.display.flip()
|
pygame.display.flip()
|
||||||
except EOFError:
|
except EOFError:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# vim:et:sw=4:ts=4:sts=4
|
# vim:et:sw=4:ts=4:sts=4
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import time
|
||||||
import serial
|
import serial
|
||||||
import getopt
|
import getopt
|
||||||
|
|
||||||
|
@ -49,6 +50,7 @@ def main():
|
||||||
except serial.serialutil.SerialException:
|
except serial.serialutil.SerialException:
|
||||||
print 'Could not open the serial device'
|
print 'Could not open the serial device'
|
||||||
return 1
|
return 1
|
||||||
|
time.sleep(2)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue