mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 22:48:29 -04:00
7c939e83e0
this gives the full resolution when using the ADC backend. It also adds scaling for the Arduino backend
12 lines
275 B
C++
12 lines
275 B
C++
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
|
|
#include "wiring.h"
|
|
#include "AP_AnalogSource_Arduino.h"
|
|
|
|
float AP_AnalogSource_Arduino::read(void)
|
|
{
|
|
float fullscale = analogRead(_pin);
|
|
float scaled = _prescale * fullscale;
|
|
return scaled;
|
|
}
|