Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pyfirmata import Arduino, util # importa classe PyFirmata e time
- import time
- board = Arduino('/dev/ttyACM0') # em board criamos uma instancia usando a porta onde nosso arduino esta
- def delay(second): # função delay igual temos no arduino
- time.sleep(second)
- def blink(second): # função blink usada para piscar led
- # board --> porta digital --> pino 13 write -> 1 Ligado
- board.digital[13].write(1)
- delay(second)
- # board --> porta digital --> pino 13 write -> 0 desligado
- board.digital[13].write(0)
- delay(second)
- x = 0
- while x < 10:
- x = x + 1
- print x
- blink(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement