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.
main.cpp
- Committer:
- ViriJay
- Date:
- 2019-01-18
- Revision:
- 0:7c3fd90d5bd9
- Child:
- 1:053b63d70298
File content as of revision 0:7c3fd90d5bd9:
#include "mbed.h"
#include "nRF24L01P.h"
SPI spi(D11, D12, D13);
DigitalOut cs(D10, 1);
nRF24L01P my_nrf24l01p(D11, D12, D13, D8, D9, D7); // mosi, miso, sck, csn, ce, irq
#define TRANSFER_SIZE 2
void toggle_led() {
led1 = !led1;
}
int main() {
// Init the ticker with the address of the function (toggle_led) to be attached and the interval (100 ms)
toggle_led_ticker.attach(&toggle_led, 0.1);
while (true) {
// Do other things...
}
}