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: TextLCD mbed-rtos mbed
Fork of ELEC_350_Coursework by
Diff: Led.h
- Revision:
- 0:8f564feffdd8
diff -r 000000000000 -r 8f564feffdd8 Led.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Led.h Sat Nov 25 15:39:56 2017 +0000
@@ -0,0 +1,21 @@
+#ifndef _LED_H_ //Known as header guards
+#define _LED_H_
+
+class Led //This creates a class called Led
+{
+
+//Below are methods of the class these are the opperations the class will support
+public: //The public: word enables the methods to be accessed outside of the class itself
+
+ Led(PinName pinName);
+ void switchOn(); //Void is the return type as no values will be output the return type is void
+ void switchOff(); //SwitchOff is the name of the method/function
+ void flash(float time); //float time is the parameter of the function in this case it creates a floating poi t variable known as time and this is then passed o the function when called.
+ void Toggle();
+
+private: //This is used here to make digitalout pin only useable from inside class Led
+ DigitalOut pin; //DigitalOut is the Class and the object is called pin the object pin is now an attribute of led this is also known as a member variable or field
+};
+
+
+#endif
\ No newline at end of file
