Jose Rios
/
Nucleo_AnalogRead
Read an analog value using ADC
main.cpp
- Committer:
- jose_23991
- Date:
- 2014-09-08
- Revision:
- 0:34080419f5c6
- Child:
- 1:c501cf08e477
File content as of revision 0:34080419f5c6:
#include "mbed.h" AnalogIn analog_sensor(A0); int main() { while(1) { uint16_t meas = analog_sensor.read_u16(); // Read the analog input (return a value in the range [0,4096] / Nucleo F401RE: 12 bits ADC) printf("\n Analog Read: %d", meas); // Show the value wait_ms(1); // Wait 1ms between reads for stability } }