Isme plot hotai LDR aur POT ka value, wrt time serial plotter ke graph me. Baud rate 9600 select karneka aur axes 2 select karna mat bhulna
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:709cf4309909
- Child:
- 1:3151bf0df238
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jul 01 09:21:15 2016 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" + +Serial pc(USBTX,USBRX); +AnalogIn pot(PTB0); +AnalogIn ldr(PTB1); +//This progeram is to be submitted for report 02 +float potf; //Declaring float value for Potentiometer reading +int poti; //Declaring int value for Potentiometer reading +float ldrf; //Declaring float value for LDR reading +int ldri; //Declaring Integer value for LDR reading + +int main() +{ + while(1) + { + ldrf=ldr.read(); + ldri=ldrf*1000; + potf=pot.read(); + poti=potf*1000; + pc.printf("$%d %d;",poti,ldri); //Printing value of LDR and Pot Float value. + pc.printf("\n \r"); + } +}