Time: 17:33 Date: 10/12/2017 Description: Task 1,7,8 Currently Functioning

Dependencies:   BME280 BMP280 TextLCD

Working Repository

Committer:
thomasmorris
Date:
Tue Jan 09 12:19:12 2018 +0000
Revision:
50:3d61ca637399
Parent:
5:2594b953f111
Dynamic Dating Working

Who changed what in which revision?

UserRevisionLine numberNew contents of line
thomasmorris 5:2594b953f111 1 #ifndef _LED_HPP_ //Known as header guards
thomasmorris 5:2594b953f111 2 #define _LED_HPP_
thomasmorris 5:2594b953f111 3
thomasmorris 5:2594b953f111 4 class LED //This creates a class called Led
thomasmorris 5:2594b953f111 5 {
thomasmorris 5:2594b953f111 6
thomasmorris 5:2594b953f111 7 //Below are methods of the class these are the opperations the class will support
thomasmorris 5:2594b953f111 8 public: //The public: word enables the methods to be accessed outside of the class itself
thomasmorris 5:2594b953f111 9
thomasmorris 5:2594b953f111 10 LED(PinName pinName);
thomasmorris 5:2594b953f111 11 void switchOn(); //Void is the return type as no values will be output the return type is void
thomasmorris 5:2594b953f111 12 void switchOff(); //SwitchOff is the name of the method/function
thomasmorris 5:2594b953f111 13 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.
thomasmorris 5:2594b953f111 14 void Toggle();
thomasmorris 5:2594b953f111 15
thomasmorris 5:2594b953f111 16 private: //This is used here to make digitalout pin only useable from inside class Led
thomasmorris 5:2594b953f111 17 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
thomasmorris 5:2594b953f111 18 };
thomasmorris 5:2594b953f111 19
thomasmorris 5:2594b953f111 20
thomasmorris 5:2594b953f111 21 #endif