Colour mixer

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
t00214916
Date:
Sat Aug 21 22:04:53 2021 +0000
Commit message:
Colour mixer

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
diff -r 000000000000 -r 117065dd7f27 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Aug 21 22:04:53 2021 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+
+Serial pc (USBTX, USBRX);
+ 
+PwmOut red(p23);
+PwmOut green(p24);
+ 
+AnalogIn pot1(p19);
+AnalogIn pot2(p20);
+ 
+float p1;
+float p2;
+
+int main() {
+    while(1) {
+        p1 = pot1;
+        p2 = pot2;
+        red = 1 - pot1;
+        green = 1 - pot2;
+        pc.printf("pot1 value = %0.2f\n\r", p1);
+        pc.printf("pot2 value = %0.2f\n\r", p2);
+        wait (2);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 117065dd7f27 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Aug 21 22:04:53 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file