Time: 17:33 Date: 10/12/2017 Description: Task 1,7,8 Currently Functioning
Dependencies: BME280 BMP280 TextLCD
Working Repository
LED.hpp
- Committer:
- thomasmorris
- Date:
- 2018-01-09
- Revision:
- 50:3d61ca637399
- Parent:
- 5:2594b953f111
File content as of revision 50:3d61ca637399:
#ifndef _LED_HPP_ //Known as header guards #define _LED_HPP_ 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