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:b43794060b94
- Child:
- 6:f804bb3faa26
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Led.cpp Thu Oct 15 10:38:34 2015 +0000
@@ -0,0 +1,20 @@
+#include "Led.h" //includes the header with the class definition
+
+//constructor
+Led::Led(string s) //contructor implementation
+{
+ if(s== "red")
+ pin= PD_14; //The pin for the red led
+
+ l = new DigitalOut(pin);
+}
+
+void Led::On() //function implementation
+{
+ l->write(1); //set the value of the pin to l
+}
+
+void Led::Off()
+{
+ l->write(0); //set the value of the pin to 0
+}
\ No newline at end of file