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.
Diff: main.cpp
- Revision:
- 0:55b07f83af75
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu May 21 02:22:22 2015 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+
+DigitalOut red(D5);
+DigitalOut blue(D8);
+DigitalOut green(D9);
+AnalogIn analog_value(A0);
+int i;
+
+int main() {
+ float meas;
+ int i;
+
+ while(1) {
+ meas = analog_value.read();
+
+ i = (int)(meas * 8);
+ red = i & 1;
+ blue = i & 2;
+ green = i & 4;
+ wait(0.2);
+ }
+}