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: xtoff2 RF24Network mbed
Fork of RF24Network_Receive by
Revision 9:e14f65b8ffc2, committed 2018-03-08
- Comitter:
- pietor
- Date:
- Thu Mar 08 09:23:20 2018 +0000
- Parent:
- 8:c43411433ce1
- Child:
- 10:0a4c465f7838
- Commit message:
- 8/03
Changed in this revision
| Ontvanger.h | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Ontvanger.h Thu Feb 22 14:08:11 2018 +0000 +++ b/Ontvanger.h Thu Mar 08 09:23:20 2018 +0000 @@ -13,10 +13,7 @@ const uint16_t this_node = 00; const uint16_t other_node = 01; -DigitalOut myled1(LED1); -DigitalOut myled2(LED2); -DigitalOut myled3(LED3); -DigitalOut myled4(LED4); +
--- 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;
