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: mbed
Fork of BoxBrovoEcho_OCt3 by
main.cpp
- Committer:
- rafael210
- Date:
- 2018-08-29
- Revision:
- 0:b265ed6faf6c
- Child:
- 1:fa78d980522c
File content as of revision 0:b265ed6faf6c:
#include "mbed.h"
Ticker scheduler1;
Ticker scheduler2;
Ticker scheduler3;
Ticker scheduler4;
DigitalOut THY_S(p5, 0);
DigitalOut IGBT_G(p6, 0);
DigitalOut led1(LED1, 0);
DigitalOut led2(LED2, 0);
void task1() {
THY_S = !THY_S;
}
void task2() {
IGBT_G = !IGBT_G;
}
void task3() {
led1 = !led1;
}
void task4() {
led2 = !led2;
}
int main() {
THY_S = 0;
IGBT_G = 0;
led1 = 0;
led2 = 0;
scheduler1.attach(&task1, 0.005); // Four independent tasks
scheduler2.attach(&task2, 0.05); //
scheduler3.attach(&task3, 0.5); //
scheduler4.attach(&task4, 1); //
while(1) {
}
}
