Himanshu Kaushik
/
voltagemeter
for 0-3 v battey pack module
main.cpp@0:0b26aa1c549c, 2021-03-02 (annotated)
- Committer:
- himanshukaushik
- Date:
- Tue Mar 02 09:31:37 2021 +0000
- Revision:
- 0:0b26aa1c549c
digital voltmeter for 0-3v
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
himanshukaushik | 0:0b26aa1c549c | 1 | #include "mbed.h" |
himanshukaushik | 0:0b26aa1c549c | 2 | Serial pc(USBTX, USBRX); |
himanshukaushik | 0:0b26aa1c549c | 3 | AnalogIn Ain(p18); |
himanshukaushik | 0:0b26aa1c549c | 4 | float ADCdata=0; |
himanshukaushik | 0:0b26aa1c549c | 5 | float b=0.3050313; |
himanshukaushik | 0:0b26aa1c549c | 6 | int main() { |
himanshukaushik | 0:0b26aa1c549c | 7 | pc.printf("ADC Data Values... \n\r"); |
himanshukaushik | 0:0b26aa1c549c | 8 | while (1) { |
himanshukaushik | 0:0b26aa1c549c | 9 | ADCdata=Ain/b; |
himanshukaushik | 0:0b26aa1c549c | 10 | pc.printf("%f \n\r",ADCdata); |
himanshukaushik | 0:0b26aa1c549c | 11 | wait(0.5); |
himanshukaushik | 0:0b26aa1c549c | 12 | } |
himanshukaushik | 0:0b26aa1c549c | 13 | } |