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:ec68cfbf0495, committed 2016-08-15
- Comitter:
- GregC
- Date:
- Mon Aug 15 18:15:42 2016 +0000
- Commit message:
- Serial and RGB LED program example for Hexiwear
Changed in this revision
diff -r 000000000000 -r ec68cfbf0495 .gitignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.gitignore Mon Aug 15 18:15:42 2016 +0000 @@ -0,0 +1,4 @@ +.build +.mbed +projectfiles +*.py*
diff -r 000000000000 -r ec68cfbf0495 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Aug 15 18:15:42 2016 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+#include "rtos.h"
+
+DigitalOut led_red(PTC8);
+DigitalOut led_green(PTD0);
+DigitalOut led_blue(PTC9);
+Serial pc(USBTX, USBRX);
+
+int main()
+{
+ pc.printf("Tell me the RGB LED Color\r\n");
+
+ while (true) {
+ pc.printf("Red\r\n"); // print the value of variable i
+ led_red=0;
+ led_green=1;
+ led_blue=1;
+ Thread::wait(1000); // wait a small period of time
+ pc.printf("Green\r\n"); // print the value of variable i
+ led_red=1;
+ led_green=0;
+ led_blue=1;
+ Thread::wait(1000); // wait a small period of time
+ pc.printf("Blue\r\n"); // print the value of variable i
+ led_red=1;
+ led_green=1;
+ led_blue=0;
+ Thread::wait(1000); // wait a small period of time
+
+ }
+}
+
diff -r 000000000000 -r ec68cfbf0495 mbed-os.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Mon Aug 15 18:15:42 2016 +0000 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/mbed-os/#0712b8adf6bbc7eb796d5dac26f95d79d40745ef