def main():
- # tell the GPIO module that we want to use the
+ # tell the GPIO module that we want to use the
# chip's pin numbering scheme
GPIO.setmode(GPIO.BCM)
GPIO.setup(26,GPIO.IN, pull_up_down=GPIO.PUD_UP)
dobar = False
trenutni=1
while dobar!=True:
- print "poslao na matricu"
-# time.sleep(1)
+ print "poslao na matricu"
+# time.sleep(1)
ON = "\x14\x82\x80\x81"
ser.write(ON)
# dobar=True
# time.sleep(0.01)
inp = ser.read(size=4)
- print inp.encode("hex")
+ print inp.encode("hex")
if inp.encode("hex") == "54828081":
- dobar=True
+ dobar=True
print("play", "dobar=", dobar, "trenutni=",trenutni)
pygame.mixer.music.play()
while pygame.mixer.music.get_busy() == True:
- continue
+ continue
else:
#print "button true"
if trenutni==1:
dobar = False
trenutni=2
while dobar!=True:
- print "poslao na matricu"
+ print "poslao na matricu"
ON = "\x14\x81\x80\x81"
time.sleep(1)
ser.write(ON)
# time.sleep(0.01)
inp = ser.read(size=4)
- print inp.encode("hex")
+ print inp.encode("hex")
if inp.encode("hex") == "54818081":
dobar=True