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: ledlib.cpp
- Revision:
- 0:f2dd1916acde
diff -r 000000000000 -r f2dd1916acde ledlib.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ledlib.cpp Wed Jul 08 10:59:04 2020 +0000
@@ -0,0 +1,23 @@
+#include "ledlib.h"
+
+LED::LED(PinName pin): LED0(pin){
+ LED0 = false;
+};
+
+void LED::on(){
+ LED0 = true;
+};
+
+void LED::off(){
+ LED0 = false;
+};
+
+void LED::toggle(){
+ LED0 = !LED0;
+};
+
+void LED::blink(float sec){
+ LED0 = !LED0;
+ wait(sec);
+ LED0 = !LED0;
+}
\ No newline at end of file