Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 #include "TextLCD.h" 00003 00004 PinName pin_IR_A = PC_0; 00005 PinName pin_IR_D = PC_12; 00006 00007 AnalogIn adc_IR(pin_IR_A); 00008 DigitalIn IR(pin_IR_D); 00009 00010 // rs, rw, e, d0-d3 00011 TextLCD lcd(PB_12, PB_13, PB_14, PB_15, PA_9, PA_10, PA_11); 00012 00013 int main() { 00014 00015 int volt, ir_d; 00016 lcd.printf(" Volt : [mV]"); 00017 lcd.locate(0, 1); 00018 lcd.printf(" IR Status : "); 00019 while(1) { 00020 volt = adc_IR.read()*3300; 00021 ir_d = IR; 00022 lcd.locate(8, 0); 00023 lcd.printf("%4d", volt); 00024 lcd.locate(13, 1); 00025 lcd.printf("%d", ir_d); 00026 wait(1); 00027 } 00028 }
Generated on Tue Jul 12 2022 23:03:02 by
1.7.2