Biswajit Padhi
/
Potentiometer
poiuyrtyuioiuytd
main.cpp@0:b22aeee85daa, 2018-06-15 (annotated)
- Committer:
- biswajit007
- Date:
- Fri Jun 15 09:05:19 2018 +0000
- Revision:
- 0:b22aeee85daa
qwertyuioiugf
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
biswajit007 | 0:b22aeee85daa | 1 | #include "mbed.h" |
biswajit007 | 0:b22aeee85daa | 2 | |
biswajit007 | 0:b22aeee85daa | 3 | DigitalOut myled(LED1); |
biswajit007 | 0:b22aeee85daa | 4 | AnalogIn Pot(A0); |
biswajit007 | 0:b22aeee85daa | 5 | Serial pc(USBTX,USBRX); |
biswajit007 | 0:b22aeee85daa | 6 | int main() { |
biswajit007 | 0:b22aeee85daa | 7 | while(1) { |
biswajit007 | 0:b22aeee85daa | 8 | |
biswajit007 | 0:b22aeee85daa | 9 | float pot = Pot.read(); |
biswajit007 | 0:b22aeee85daa | 10 | pc.printf("The value of sensor is: %f\n", pot*1000); |
biswajit007 | 0:b22aeee85daa | 11 | |
biswajit007 | 0:b22aeee85daa | 12 | |
biswajit007 | 0:b22aeee85daa | 13 | } |
biswajit007 | 0:b22aeee85daa | 14 | } |