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.
Stoplicht.cpp
- Committer:
- jeroenvz
- Date:
- 2015-12-18
- Revision:
- 0:e9239870dd85
File content as of revision 0:e9239870dd85:
#include "mbed.h"
class Stoplicht
{
private:
bool mStoplichtRood; // True = rood, false = groen
DigitalOut* mGroen;
DigitalOut* mRood;
public:
Stoplicht(PinName rood, PinName groen){
mGroen = new DigitalOut(groen);
mRood = new DigitalOut(rood);
*mGroen = true;
*mRood = true;
}
void set_Groen(){
*mRood = true;
*mGroen = false;
mStoplichtRood = false;
}
void set_Rood(){
*mGroen = true;
*mRood = false;
mStoplichtRood = true;
}
bool get_Status(){
return mStoplichtRood;
}
};