diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2011-10-13 19:56:29 +0200 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2011-10-13 19:56:29 +0200 |
commit | fad9dd56d73a9b9917177ecf1114dffc3052fa64 (patch) | |
tree | dd61cf5b52e45ad59ff2bcd4ea2cbfb3142f5f29 /liboctopus/python/demos/adc.py | |
parent | cbc941282074856fc6179761b70a0c9879b0b64d (diff) | |
download | mini-octopus-fad9dd56d73a9b9917177ecf1114dffc3052fa64.tar.gz mini-octopus-fad9dd56d73a9b9917177ecf1114dffc3052fa64.zip |
python reader stuff
Diffstat (limited to 'liboctopus/python/demos/adc.py')
-rw-r--r-- | liboctopus/python/demos/adc.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/liboctopus/python/demos/adc.py b/liboctopus/python/demos/adc.py index 5e55ab7..338eea9 100644 --- a/liboctopus/python/demos/adc.py +++ b/liboctopus/python/demos/adc.py @@ -10,10 +10,14 @@ octopus_open(op) octopus_adc_init(op, 33) octopus_adc_ref(op, 2) + +ADC_REV_MV = 5000 while 1: value = octopus_adc_get(op, 33) - callin = "Value %i" % value - print callin - time.sleep(1) + value_mv = ((ADC_REV_MV/1024.0) * value) / 4.0 + value_dba = value_mv / 10 + print "value={0}, {1}mV, {2}dbA".format(value, value_mv, value_dba) + + time.sleep(0.4) |