Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
7148_Labs_2223/Session2/Solution_Classes/src/flasher.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
40 lines (29 sloc)
952 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is the headerfile for our class. | |
It contains details of the class and all its methods. | |
This includes definitions, and the function signatures. | |
It is used by the compiler to link code from class files, into our main program. | |
*/ | |
// Avoid the compiler including code every time it is imported | |
#ifndef FLASHER_H | |
#define FLASHER_H | |
// We Will need mbed for definitions of DigitalOut etc. | |
#include <mbed.h> | |
// Here we define the class structure, and variables | |
class Flasher{ | |
// Variables | |
private: | |
DigitalOut theLed; | |
int state; | |
/* | |
We then define the method sigantures here. | |
NOTE: We just define the signatures, the code code in the corrisponding .c file | |
*/ | |
public: | |
// Constructor. NOTE: We dont include the definition list here | |
Flasher(PinName thePin, int startState); | |
// Public Methods | |
void flash(); //Our standard Flash | |
void set_state(int the_state); //Setter method for the state | |
}; | |
#endif |