forked from robovero/python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
adc.py
31 lines (25 loc) · 702 Bytes
/
adc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""Acquire and display ADC readings using the Arduino API.
"""
from robovero.arduino import analogRead, AD0_0, AD0_1, AD0_2, AD0_3, AD0_5, AD0_6, AD0_7
from robovero.extras import roboveroConfig
from time import sleep
__author__ = "Neil MacMunn"
__email__ = "neil@gumstix.com"
__copyright__ = "Copyright 2010, Gumstix Inc"
__license__ = "BSD 2-Clause"
__version__ = "0.1"
roboveroConfig()
try:
while True:
data = [
analogRead(AD0_0),
analogRead(AD0_1),
analogRead(AD0_2),
analogRead(AD0_3),
analogRead(AD0_5),
analogRead(AD0_6),
analogRead(AD0_7)
]
print data
except KeyboardInterrupt:
exit("\nkeyboard interrupt: how rude!")