Skip to content

Commit 1edfcec

Browse files
z3ckapi
authored and
pi
committed
makes text scroll to the left then right over and over again
1 parent 2c0e119 commit 1edfcec

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

Adafruit_CharLCDPlate/Adafruit_CharLCDPlate_thanks.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,20 @@
1616
# Calc how many spaces to move
1717
move = len(message) - 16
1818

19-
sleep(1)
20-
21-
# Scroll display
22-
for x in range(0,move):
23-
lcd.scrollDisplayLeft()
24-
sleep(0.15)
25-
# Wait half a second
26-
sleep(0.5)
27-
# Scroll display back
28-
for x in range(0, move):
29-
lcd.scrollDisplayRight()
30-
sleep(0.08)
19+
# make infinite loop
20+
loop = 1
21+
while True:
22+
# Wait one second
23+
sleep(1)
24+
# Scroll display
25+
for x in range(0,move):
26+
lcd.scrollDisplayLeft()
27+
sleep(0.15)
28+
# Wait half a second
29+
sleep(0.5)
30+
# Scroll display back
31+
for x in range(0, move):
32+
lcd.scrollDisplayRight()
33+
sleep(0.08)
34+
loop += 1
3135

0 commit comments

Comments
 (0)