Hisyam Sulaiman
/
ADC
cg
main.cpp@1:877582fb6b65, 2018-05-24 (annotated)
- Committer:
- HisyamSulaiman
- Date:
- Thu May 24 04:11:22 2018 +0000
- Revision:
- 1:877582fb6b65
- Parent:
- 0:a060af406e72
aqil
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
HisyamSulaiman | 0:a060af406e72 | 1 | #include "mbed.h" |
HisyamSulaiman | 0:a060af406e72 | 2 | #include "TextLCD.h" |
HisyamSulaiman | 0:a060af406e72 | 3 | |
HisyamSulaiman | 0:a060af406e72 | 4 | TextLCD lcd(D8, D9, D4, D5, D6, D7); |
HisyamSulaiman | 0:a060af406e72 | 5 | Serial pc(USBTX, USBRX); |
HisyamSulaiman | 0:a060af406e72 | 6 | AnalogIn Ain(PC_3); |
HisyamSulaiman | 0:a060af406e72 | 7 | float ADCdata; |
HisyamSulaiman | 0:a060af406e72 | 8 | |
HisyamSulaiman | 0:a060af406e72 | 9 | int main() { |
HisyamSulaiman | 1:877582fb6b65 | 10 | |
HisyamSulaiman | 1:877582fb6b65 | 11 | lcd.locate (1,0); |
HisyamSulaiman | 1:877582fb6b65 | 12 | lcd.printf("Temp Measure"); |
HisyamSulaiman | 1:877582fb6b65 | 13 | lcd.locate (0,1); |
HisyamSulaiman | 1:877582fb6b65 | 14 | lcd.printf("Cel"); |
HisyamSulaiman | 1:877582fb6b65 | 15 | lcd.locate (8,1); |
HisyamSulaiman | 1:877582fb6b65 | 16 | lcd.printf("Fah"); |
HisyamSulaiman | 1:877582fb6b65 | 17 | |
HisyamSulaiman | 1:877582fb6b65 | 18 | /*while(1) { |
HisyamSulaiman | 0:a060af406e72 | 19 | ADCdata=Ain; |
HisyamSulaiman | 1:877582fb6b65 | 20 | ADCdata=ADCdata; |
HisyamSulaiman | 0:a060af406e72 | 21 | lcd.locate (4,1); |
HisyamSulaiman | 0:a060af406e72 | 22 | lcd.printf("%f",ADCdata); |
HisyamSulaiman | 0:a060af406e72 | 23 | pc.printf("%f\n\r",ADCdata); |
HisyamSulaiman | 1:877582fb6b65 | 24 | lcd.locate (11,1); |
HisyamSulaiman | 1:877582fb6b65 | 25 | lcd.printf("%f",ADCdata); |
HisyamSulaiman | 1:877582fb6b65 | 26 | pc.printf("%f\n\r",ADCdata); |
HisyamSulaiman | 1:877582fb6b65 | 27 | wait(0.5);*/ |
HisyamSulaiman | 0:a060af406e72 | 28 | } |
HisyamSulaiman | 1:877582fb6b65 | 29 |