mirror of https://github.com/ARMmbed/mbed-os.git
Fix styling and fix mbed_lib.json syntax error
parent
b76300f57c
commit
7b70843632
|
@ -44,6 +44,7 @@
|
|||
},
|
||||
"default-adc-vref": {
|
||||
"help": "Default reference voltage for ADC (float)",
|
||||
"value": 3.3f
|
||||
"value": "3.3f"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,16 +54,18 @@ unsigned short AnalogIn::read_u16()
|
|||
return ret;
|
||||
}
|
||||
|
||||
float AnalogIn::read_volts() {
|
||||
float ret = this->read();
|
||||
return (ret*this->vref);
|
||||
float AnalogIn::read_volts()
|
||||
{
|
||||
return (this->read() * this->vref);
|
||||
}
|
||||
|
||||
void AnalogIn::set_reference_voltage(float vref) {
|
||||
void AnalogIn::set_reference_voltage(float vref)
|
||||
{
|
||||
this->vref = vref;
|
||||
}
|
||||
|
||||
float AnalogIn::get_reference_voltage(void) {
|
||||
float AnalogIn::get_reference_voltage(void)
|
||||
{
|
||||
return this->vref;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue