Created
June 13, 2018 23:12
-
-
Save MrYsLab/38bd302f50ef0f1ed77b90166ca485d2 to your computer and use it in GitHub Desktop.
three_analog.py
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 pymata_aio.pymata3 import PyMata3 | |
from pymata_aio.constants import Constants | |
board = PyMata3(2) | |
pins = [0, 1, 2] | |
# set pin mode for analog pins 0 - 2 | |
for pin in pins: | |
board.set_pin_mode(pin, Constants.ANALOG) | |
while True: | |
for pin in pins: | |
data = board.analog_read(pin) | |
# if you need a short delay - set to value that works for your hardware | |
# board.sleep(.1) | |
print(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment