Andrew Tridgell
a361a3aebd
AP_AnalogSource: make read_average() return a float
...
this allows it to take advantage of better than 1 bit resolution by
averaging
2012-08-15 12:39:35 +10:00
Andrew Tridgell
99410cbbfe
AP_AnalogSource: fixed reporting of VCC
...
the VCC pin number should not be converted
2012-07-21 19:49:24 +10:00
rmackay9
1105a35c77
AP_AnalogSource_Arduino: fix to allow analog port to be read to be specified as a "channel" (i.e. A0)
...
Also fixed example range finder sketch to work with interrupt enabled AP_AnalogSource_Arduino class
2012-07-11 21:19:17 +09:00
Andrew Tridgell
ec70e87495
AnalogSource: prevent a division by zero on zero ADC data
2012-07-06 19:59:18 +10:00
Andrew Tridgell
2bd5cd3b9a
AnalogSource: added some example code
2012-07-01 15:01:05 +10:00
Andrew Tridgell
2046e396a2
AnalogSource: make the Arduino AnalogSource interrupt driven
...
this fixes several problems with reading analog sources:
- we were getting poor values because we didn't wait long enough for
an analog source to settle
- we wasted a lot of CPU cycles waiting for conversions
- we were not taking averages over many samples, which we did with
the old AP_ADC driver on the APM1
2012-07-01 15:01:05 +10:00
Randy Mackay
98f3386ea0
Arduino 1.0 - changed all #includes of "WProgram.h", "wiring.h" and "WConstants.h to "Arduino.h".
...
Modified FastSerial's write function to return size_t (number of bytes written).
2012-01-28 12:25:47 +09:00
Andrew Tridgell
7c939e83e0
AnalogSource: return a float from read() method
...
this gives the full resolution when using the ADC backend. It also
adds scaling for the Arduino backend
2011-12-17 07:29:09 +11:00
Randy Mackay
ffb4492c16
RangeFinder - small bug fix to initialise prescale variable.
...
Fixed up example sketch so it compiles and works again!
2011-12-10 16:25:41 +09:00
Pat Hickey
0caf351c32
purple: Added AnalogSource library
...
this library abstracts out the way of getting an analog value. If the
ADC library is being used then it calls the ADC Ch() method, otherwise
it calls analogRead()
2011-11-25 20:00:16 -08:00