Using the pot to change the intensity of the LEDS and printing out a value of the pot to the LCD display

Dependencies:   mbed C12832

Files at this revision

API Documentation at this revision

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

C12832.lib Show annotated file Show diff for this revision Revisions of this file
POT.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/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