Skip to content
Permalink
e88b206f40
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
38 lines (30 sloc) 753 Bytes
/* cpp file to go with the header.
In here we define all the program logic,
matching the function signatures in the header file.
NOTE: We just include functionality here.
Class variables etc come from the header file.
*/
#include "flasher.h"
#include "mbed.h"
// Define our constructor
Flasher::Flasher(PinName thePin, int startState) : theLed(thePin){
state = startState;
}
// Define Flash Functionality.
void Flasher::flash(){
if (state == 0){
theLed = 1;
thread_sleep_for(1000);
theLed = 0;
thread_sleep_for(1000);
}
else {
theLed = 1;
thread_sleep_for(5000);
theLed = 0;
thread_sleep_for(5000);
}
}
void Flasher::set_state(int the_state){
state = the_state;
}