Compare commits
No commits in common. "652b217defc100e6277b5c01360574ebd01afdbd" and "c57a3d5b3670272c7d964116194a1372238176d1" have entirely different histories.
652b217def
...
c57a3d5b36
16
Pi/s.py
16
Pi/s.py
|
@ -4,8 +4,8 @@ import serial
|
||||||
import pygame
|
import pygame
|
||||||
|
|
||||||
serialmode=True #True for Raspberry Pi with Arduino connected, False for testing with keyboard
|
serialmode=True #True for Raspberry Pi with Arduino connected, False for testing with keyboard
|
||||||
serialport="/dev/ttyS0" # Raspberry Pi
|
#serialport="/dev/ttyS0" # Raspberry Pi
|
||||||
# serialport="/dev/ttyUSB0"
|
serialport="/dev/ttyUSB0"
|
||||||
|
|
||||||
pygame.mixer.pre_init(buffer=32)
|
pygame.mixer.pre_init(buffer=32)
|
||||||
pygame.init()
|
pygame.init()
|
||||||
|
@ -89,21 +89,13 @@ while True:
|
||||||
Sound[i].stop()
|
Sound[i].stop()
|
||||||
Sound[i].play()
|
Sound[i].play()
|
||||||
Soundplaying[i]=True
|
Soundplaying[i]=True
|
||||||
#print(str(i), end='')
|
print("play "+str(i))
|
||||||
i+=1
|
i+=1
|
||||||
else: #changed to 0
|
else: #changed to 0
|
||||||
if Soundplaying[i]:
|
if Soundplaying[i]:
|
||||||
#Sound[i].stop()
|
#Sound[i].stop()
|
||||||
Sound[i].fadeout(500)
|
Sound[i].fadeout(500)
|
||||||
Soundplaying[i]=False
|
Soundplaying[i]=False
|
||||||
# print("stop "+str(i), end='')
|
print("stop "+str(i))
|
||||||
|
|
||||||
for i in range(8):
|
|
||||||
if Soundplaying[i]:
|
|
||||||
print(str(i), end='')
|
|
||||||
else:
|
|
||||||
print(" ", end='')
|
|
||||||
print("", end='\r')
|
|
||||||
|
|
||||||
oldrcv = rcv
|
oldrcv = rcv
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue