Commit Graph

6 Commits

Author SHA1 Message Date
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 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
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