Created
January 30, 2018 11:26
-
-
Save anonymous/2b592dbb1f0f1c0dadaf1e4547cd0eec to your computer and use it in GitHub Desktop.
Simple Python program to flash onboard LED of Arduino UNO. Requires pyfirmata.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyfirmata import Arduino, util | |
import time | |
board = Arduino("COM3") | |
loopTimes = input('How many times would you like the LED to blink: ') | |
print("Blinking " + loopTimes + " times.") | |
for x in range(int(loopTimes)): | |
board.digital[13].write(1) | |
time.sleep(0.2) | |
board.digital[13].write(0) | |
time.sleep(0.2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from pyfirmata import Arduino, util
import time
// WINDOWS
board = Arduino("COM3")
//LINUX
//board = Arduino("/dev/ttyACM0")
loopTimes = input('How many times would you like the LED to blink: ')
print("Blinking %d times.", loopTimes)
for x in range(int(loopTimes)):