Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
university:tools:python-tutorial:tutorial3-potentiometer [12 Sep 2019 20:12] – [Activity: Potentiometer] Doug Merceruniversity:tools:python-tutorial:tutorial3-potentiometer [12 Dec 2019 17:56] – [Background:] Doug Mercer
Line 16: Line 16:
  
 To measure an input voltage on a channel first we must set the mode to high impedance: To measure an input voltage on a channel first we must set the mode to high impedance:
-CHA.set_mode('d''D' or 'd' set channel to high impedance mode, measure voltage+CHA.mode = Mode.HI_Z # set channel to high impedance mode, measure voltage
  
-Then we can acquire some number of input samples to a list ( in variable AnalogInA ):\\ +Then we can acquire some number of input samples to a list ( in variable ADsignal1 ):\\ 
-AnalogInA CHA.get_samples(20) # get 20 readings+ADsignal1 devx.read(20, -1, True) # get 20 readings
  
 It will then be possible to add the 20 values and calculate an average for example. It will then be possible to add the 20 values and calculate an average for example.
university/tools/python-tutorial/tutorial3-potentiometer.txt · Last modified: 03 Nov 2021 20:41 by Doug Mercer