![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
dd
Dependencies: xtoff2 RF24Network mbed
Fork of xtoff3 by
main.cpp
- Committer:
- pietor
- Date:
- 2018-02-19
- Revision:
- 6:6a82110ff393
- Parent:
- 4:7ebc3b421306
- Child:
- 7:8515f205483b
File content as of revision 6:6a82110ff393:
/** Main.cpp Purpose: main class @author Pieter Berteloot */ #include "mbed.h" #include "Ontvanger.h" DigitalOut myled1(LED1); DigitalOut myled2(LED2); DigitalOut myled3(LED3); DigitalOut myled4(LED4); Serial pc(USBTX, USBRX); Ontvanger receive; Timer t; void acitvateLed() { t.reset(); } int main() { pc.baud(9600); pc.printf("Ontvangger: \r\n"); t.start(); while(1) { receive.update(); while (receive.available()) { payload_t payload; payload = receive.read(); pc.printf("%d\r\n",payload.milligram); if (payload.reedsensor) acitvateLed(); } if (t.read() <= 1) myled1 = myled2 = myled3 = myled4 = 1; else myled1 = myled2 = myled3 = myled4 = 0; } }