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 xtoff3 by
Revision 10:0a4c465f7838, committed 2018-03-09
- Comitter:
- pietor
- Date:
- Fri Mar 09 08:26:00 2018 +0000
- Parent:
- 9:e14f65b8ffc2
- Child:
- 11:77018fac195e
- Commit message:
- 9/03
Changed in this revision
--- a/Ontvanger.cpp Thu Mar 08 09:23:20 2018 +0000
+++ b/Ontvanger.cpp Fri Mar 09 08:26:00 2018 +0000
@@ -7,10 +7,11 @@
Ontvanger::Ontvanger()
{
- wait_ms(1000);
radio.begin();
network.begin(90, this_node);
wait_ms(2000);
+ radio.setPALevel(RF24_PA_MIN);
+ radio.setDataRate(RF24_250KBPS);
};
void Ontvanger::update()
@@ -39,4 +40,14 @@
return network.write(header_tx,&packet,sizeof(packet));
}
+bool Ontvanger::isValid()
+{
+ return radio.isValid();
+}
+bool Ontvanger::testRPD()
+{
+ return radio.testRPD();
+}
+
+
--- a/Ontvanger.h Thu Mar 08 09:23:20 2018 +0000
+++ b/Ontvanger.h Fri Mar 09 08:26:00 2018 +0000
@@ -51,6 +51,8 @@
bool available();
bool write(state_Packet message);
payload_t read();
+ bool isValid();
+ bool testRPD();
};
#endif
--- a/main.cpp Thu Mar 08 09:23:20 2018 +0000
+++ b/main.cpp Fri Mar 09 08:26:00 2018 +0000
@@ -36,12 +36,16 @@
int main()
{
+ pc.printf("\r\nOntvanger: \r\n");
+ pc.printf("testing Radio... %d", receive.isValid());
+ pc.printf("testing Carrier... %d", receive.testRPD());
+
+
while(1) {
- //receive.update();
+ receive.update();
switch (current_state) {
case init_state:
pc.baud(9600);
- pc.printf("Ontvangger: \r\n");
t.start();
state_Packet packet;
payload_t payload;
