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: led.cpp
- Revision:
- 0:3cabc617d433
- Child:
- 1:55b5e6d28fb3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/led.cpp Sat Nov 18 17:03:48 2017 +0000
@@ -0,0 +1,24 @@
+#include "LED.h"
+#include "mbed.h"
+
+ LED::LED(PinName pin): LEDpin(pin) {
+ LEDpin=0;
+}
+
+void LED::ledOn(){
+ LEDpin = 1;
+}
+
+void LED::ledOff(){
+ LEDpin = 0;
+}
+
+void LED::toggle(){
+ LEDpin = !LEDpin;
+}
+
+void LED::blink(float duration) {
+ this->toggle();
+ wait(duration);
+ this->toggle();
+}