Skip to content

Instantly share code, notes, and snippets.

/blink.py
Created Jan 30, 2018

Embed
What would you like to do?
Simple Python program to flash onboard LED of Arduino UNO. Requires pyfirmata.
@brun0eduard0

This comment has been minimized.

Copy link

brun0eduard0 commented Jun 25, 2019

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)):

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
You can’t perform that action at this time.