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.
Revision 0:8b5e08bc95af, committed 2010-08-29
- Comitter:
- takeuchi
- Date:
- Sun Aug 29 04:21:36 2010 +0000
- Commit message:
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Aug 29 04:21:36 2010 +0000 @@ -0,0 +1,32 @@ +// ADC3 +#include "mbed.h" +#include "TextLCD.h" + +#define ON 1 +#define OFF 0 + +DigitalOut mled1(LED1); +DigitalOut mled2(LED2); +DigitalOut mled3(LED3); +DigitalOut mled4(LED4); +AnalogIn vin_adc(p20); +AnalogIn vr_adc(p19); + +TextLCD lcd(p24, p25, p26, p27, p28, p29, p30,16,2); // rs, rw, e, d0, d1, d2, d3 +float adc_volt; + +int main() { + float vr_data; + while(1){ + vr_data=vr_adc.read(); + lcd.cls(); + lcd.locate(0,0); + lcd.printf("Vin:%2.1fV",vin_adc.read()*15); + lcd.locate(0,1); + lcd.printf("Vr:%2.1fV",vr_data); + mled1=ON; + wait(vr_data); + mled1=OFF; + wait(vr_data); + }//while +}//main
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Aug 29 04:21:36 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da