![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
dd
Dependencies: xtoff2 RF24Network mbed
Fork of xtoff3 by
Diff: main.cpp
- Revision:
- 11:77018fac195e
- Parent:
- 10:0a4c465f7838
- Child:
- 12:a3dd2ebf8f93
--- a/main.cpp Fri Mar 09 08:26:00 2018 +0000 +++ b/main.cpp Fri Mar 09 12:22:27 2018 +0000 @@ -3,7 +3,27 @@ Purpose: main class @author Pieter Berteloot + + RF24 PINOUT: + ---- ----- + |GND | VCC | + |---- | + |CE CSN | + |SCK MOSI| + |MISO IRQ | + ---- ----- + + ---- ----- + |GND | Vout| + |---- | + |p9 p8 | + |p7 p5 | + |p6 NC | + ---- ----- */ +//uncommend #define PRINT_ENABLE to see informational prints +//#define PRINT_ENABLE + #include "mbed.h" #include "Ontvanger.h" @@ -36,10 +56,9 @@ int main() { - pc.printf("\r\nOntvanger: \r\n"); - pc.printf("testing Radio... %d", receive.isValid()); - pc.printf("testing Carrier... %d", receive.testRPD()); - + IF_PRINT_ENABLE( pc.printf("\r\nOntvanger: \r\n"); + pc.printf("testing Radio... %d\r\n", receive.isValid()); + ); while(1) { receive.update(); @@ -53,13 +72,13 @@ break; case send_state: - pc.printf("Send State\n\r"); + IF_PRINT_ENABLE(pc.printf("Send State\n\r");); packet.setState = State_position; bool ok = receive.write(packet); if (ok) - pc.printf("ok.\n\r"); + IF_PRINT_ENABLE(pc.printf("ok.\n\r");); else - pc.printf("failed.\n\r"); + IF_PRINT_ENABLE(pc.printf("failed.\n\r");); wait(0.1); setCurrentState(receive_state); break;