4 import RPi.GPIO as GPIO
11 parity=serial.PARITY_NONE,
12 stopbits=serial.STOPBITS_ONE,
13 bytesize=serial.EIGHTBITS,
22 # tell the GPIO module that we want to use the
23 # chip's pin numbering scheme
24 GPIO.setmode(GPIO.BCM)
25 GPIO.setup(26,GPIO.IN, pull_up_down=GPIO.PUD_UP)
27 pygame.mixer.music.load("/media/usb0/muzika.mp3")
30 # setup pin 25 as an output
32 # GPIO.setup(24,GPIO.OUT)
33 # GPIO.setup(25,GPIO.OUT)
36 # GPIO.output(25,True)
40 # the button is being pressed, so turn on the green LED
41 # and turn off the red LED
42 # GPIO.output(24,True)
43 # GPIO.output(25,False)
49 print "poslao na matricu"
51 ON = "\x14\x82\x80\x81"
55 inp = ser.read(size=4)
56 print inp.encode("hex")
57 if inp.encode("hex") == "54828081":
59 pygame.mixer.music.play()
60 while pygame.mixer.music.get_busy() == True:
68 print "poslao na matricu"
69 ON = "\x14\x81\x80\x81"
73 inp = ser.read(size=4)
74 print inp.encode("hex")
75 if inp.encode("hex") == "54818081":
87 if __name__=="__main__":