
Using the pot to change the intensity of the LEDS and printing out a value of the pot to the LCD display
Revision 0:40f8abf6ee00, committed 2020-08-01
- Comitter:
- T00209563
- Date:
- Sat Aug 01 15:42:07 2020 +0000
- Commit message:
- Using the pot to change the intensity of the leds
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C12832.lib Sat Aug 01 15:42:07 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/corentinlambert70100/code/C12832/#e03dd378e2b0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/POT.cpp Sat Aug 01 15:42:07 2020 +0000 @@ -0,0 +1,25 @@ +#include "mbed.h" +#include "C12832.h" + +C12832 lcd(p5,p7,p6,p8,p11); +PwmOut led1(LED1); +PwmOut led2(LED2); +PwmOut led3(LED3); +PwmOut led4(LED4); +AnalogIn pot1(p19); +float value ; + + + +int main() +{ + while(1) { + value = pot1; + led1=led2=led3 =led4=pot1; + wait(0.01); + lcd.locate(0,9); + lcd.printf ("value is %.2f \n", value); + lcd.locate(0,0); + lcd.printf ("value is %.2e \n", value); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Aug 01 15:42:07 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file