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: mbed RF24Network RF24
Revision 5:ddab03ae19aa, committed 2019-02-14
- Comitter:
- guillaume6544
- Date:
- Thu Feb 14 10:57:11 2019 +0000
- Parent:
- 4:93d0253a8a32
- Child:
- 6:4840dd0ef133
- Commit message:
- rec
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Jan 21 15:03:09 2019 +0000
+++ b/main.cpp Thu Feb 14 10:57:11 2019 +0000
@@ -3,6 +3,9 @@
#include <RF24.h>
Serial pc(USBTX, USBRX);
+InterruptIn button(D8);
+
+PwmOut mypwm(D5);
RF24 radio(SPI_MOSI, SPI_MISO, SPI_SCK, D9, SPI_CS );
@@ -28,9 +31,20 @@
unsigned long counter;
};
+//interruption du NRF24
+void pressed()
+{
+ mypwm.write(0.5);
+}
int main()
{
+ button.enable_irq();
+ button.rise(&pressed);
+ mypwm.period_us(30);
+ mypwm.pulsewidth_us(15);
+ mypwm.write(0.0);
+
pc.baud(115200);
wait_ms(1000);
@@ -52,6 +66,9 @@
payload_t payload_rx;
network.read(header_rx,&payload_rx,sizeof(payload_rx));
pc.printf("Received packet # %d at %d ms\r\n",payload_rx.counter,payload_rx.ms);
+
+ wait_ms(2);
+ mypwm.write(0.0);
}
}
--- a/mbed.bld Mon Jan 21 15:03:09 2019 +0000 +++ b/mbed.bld Thu Feb 14 10:57:11 2019 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11 \ No newline at end of file +https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc \ No newline at end of file