Debian Codegraph @

examples/atmega32/adc_example.py

raw symbols SCIP
1 # Read ADC Values and plot them
2 import time
3 #from kuttyPy import *
4 from matplotlib import pyplot as plt
5
6 setReg('ADMUX', (1<<6) | 5) #REF_AVCC | Channel 5
7 for a in range(50):
8 setReg('ADCSRA', 196)
9 cl = getReg('ADCL')
10 ch = getReg('ADCH')
11 plt.scatter(a, (ch<<8)|cl ,s=5)
12 plt.pause(0.01) #Wait 10 mS