Private
Public Access
2
0

examples/aio: Added examples for mraa_aio_read_float()/readFloat()

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Alex Tereschenko
2015-02-04 20:09:56 +01:00
committed by Brendan Le Foll
parent cd6701d604
commit e7c3c17eb3
4 changed files with 9 additions and 0 deletions

View File

@@ -28,6 +28,7 @@
int main ()
{
uint16_t adc_value;
float adc_value_float;
mraa::Aio* a0;
a0 = new mraa::Aio(0);
@@ -37,7 +38,9 @@ int main ()
for(;;) {
adc_value = a0->read();
adc_value_float = a0->readFloat();
fprintf(stdout, "ADC A0 read %X - %d\n", adc_value, adc_value);
fprintf(stdout, "ADC A0 read float - %.5f\n", adc_value_float);
}
return MRAA_SUCCESS;