Alberto Piganti
/
blip_analog
miniblip analog example
Fork of AnalogIn-HelloWorld by
main.cpp
- Committer:
- pighixxx
- Date:
- 2015-11-26
- Revision:
- 2:7734a904c531
- Parent:
- 0:101a12a915c6
File content as of revision 2:7734a904c531:
// miniblip analog in // photoresistor: P0_23 // external analogs: P0_15, P0_14, P0_13, P0_12, P0_11 #include "mbed.h" // Initialize a pins to perform analog input and digital output fucntions AnalogIn ain(P0_23); Serial pc(USBTX, USBRX); int main(void) { while (1) { // print the percentage and 16 bit normalized values pc.printf("Perc: %3.3f%%\n", ain.read()*100.0f); pc.printf("Norm: 0x%04X \n", ain.read_u16()); wait(0.2f); } }