Plymouth ELEC351 Group T / Mbed OS ELEC351

Dependencies:   BME280 BMP280 TextLCD

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LED.hpp Source File

LED.hpp

00001 #ifndef _LED_HPP_ //Known as header guards
00002 #define _LED_HPP_
00003 
00004 class LED //This creates a class called Led
00005 {
00006     
00007 //Below are methods of the class these are the opperations the class will support
00008 public: //The public: word enables the methods to be accessed outside of the class itself
00009 
00010     LED(PinName pinName);
00011     void switchOn(); //Void is the return type as no values will be output the return type is void
00012     void switchOff();   //SwitchOff is the name of the method/function
00013     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.
00014     void Toggle();
00015     
00016 private:    //This is used here to make digitalout pin only useable from inside class Led    
00017     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    
00018 };
00019 
00020 
00021 #endif