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.
MyBlinker.cpp
- Committer:
- clemounet
- Date:
- 2015-04-14
- Revision:
- 4:eef83534b19e
- Parent:
- 2:6cc4c56940af
File content as of revision 4:eef83534b19e:
#include "MyBlinker.h"
#define BLINKER_THREAD_STACK_SIZE   128
MyBlinker::MyBlinker(PwmOut *o, int32_t d, float hState, float lState): MyThread("MyBlinker",BLINKER_THREAD_STACK_SIZE) {
    led = o;
    delay = d;
    highState = hState;
    lowState = lState;
}
void MyBlinker::setDelay(int32_t d) {
    delay = d;
}
void MyBlinker::setHighState(float hState) {
    highState = hState;
}
void MyBlinker::setLowState(float lState) {
    lowState = lState;
}
void MyBlinker::Main(void) {
    while(running){
        led->write(highState);
        Wait(delay);
        led->write(lowState);
        Wait(delay);
    }
}