![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
dd
Dependencies: xtoff2 RF24Network mbed
Fork of xtoff3 by
Diff: main.cpp
- Revision:
- 9:e14f65b8ffc2
- Parent:
- 8:c43411433ce1
- Child:
- 10:0a4c465f7838
--- a/main.cpp Thu Feb 22 14:08:11 2018 +0000 +++ b/main.cpp Thu Mar 08 09:23:20 2018 +0000 @@ -11,6 +11,10 @@ Ontvanger receive; Timer t; +DigitalOut myled1(LED1); +DigitalOut myled2(LED2); +DigitalOut myled3(LED3); +DigitalOut myled4(LED4); State2 current_state = init_state; @@ -33,7 +37,7 @@ int main() { while(1) { - receive.update(); + //receive.update(); switch (current_state) { case init_state: pc.baud(9600); @@ -45,6 +49,7 @@ break; case send_state: + pc.printf("Send State\n\r"); packet.setState = State_position; bool ok = receive.write(packet); if (ok) @@ -57,7 +62,6 @@ case receive_state: pc.printf("");//print niet weg doen, één of andere reden werkt het dan wel - if (receive.available()) { payload_t payload; payload = receive.read(); @@ -67,8 +71,9 @@ } } - if (t.read() <= 1) + if (t.read() <= 1){ myled1 = myled2 = myled3 = myled4 = 1; + } else myled1 = myled2 = myled3 = myled4 = 0;