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: BME280 BMP280 TextLCD
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
Generated on Sun Jul 31 2022 05:12:27 by
1.7.2