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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:dff21578688b
diff -r 000000000000 -r dff21578688b main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Aug 13 01:25:25 2016 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+#include "Blinker.h"
+
+//This creates Pulse Width Modulated outputs, r and g, and connects them to the red and green LED.
+PwmOut r(LED_RED);
+PwmOut g(LED_GREEN);
+
+int main()
+{
+// setup instance of new Blinker class, myBlinker
+ Blinker myBlinker;
+ while(1) {
+ for(float i = 0; i < 5; i++) {
+ // blinks the green LED at 2 Hz, with 75% brightness
+ myBlinker.blink(g, 2, .75);
+ }
+ for(float i = 0; i < 10; i++) {
+ // blinks the red LED at 4 Hz, with 15% brightness
+ myBlinker.blink(r, 4, .15);
+ }
+
+ }
+}
+