Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Commit

Permalink
Updated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MrYsLab authored and MrYsLab committed Oct 11, 2018
1 parent 92ffb04 commit efc259a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/blink.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,40 @@
from pymata_aio.pymata3 import PyMata3
from pymata_aio.constants import Constants

# Arduino LED is on pin 13
BOARD_LED = 13

# If you are having problems connecting, you may
# wish to add some time the arduino_wait parameter.

# replace:
# board = PyMata3()
# with:
# board = PyMata3(arduino_wait=5)

# adjust the arduino_wait value to meet the needs
# of your computer

# instantiate PyMata3
board = PyMata3()


def setup():
"""
Set the Arduino BOARD_LED pin as an output
:return:
"""
board.set_pin_mode(BOARD_LED, Constants.OUTPUT)


def loop():
"""
Toggle the LED by alternating the values written
to the LED pin. Wait 1 second between writes.
Also note the use of board.sleep and not
time.sleep.
:return:
"""
print("LED On")
board.digital_write(BOARD_LED, 1)
board.sleep(1.0)
Expand Down

0 comments on commit efc259a

Please sign in to comment.