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-os nRF24L01P
main.cpp
- Committer:
- emerichartmann
- Date:
- 2022-01-14
- Revision:
- 8:04ab02bb2262
- Parent:
- 7:65236900b1f5
- Child:
- 9:67d737d8a349
File content as of revision 8:04ab02bb2262:
/* RobotCup ENS Paris Saclay 2020-2021 Team FC Furious Code by Luc DERRIEN adapted by Eve Programme communication PC-Robot Point de vue : PC micro controleur : L475 envoi d'une chaine de caractère de taille TRANSFER_SIZE */ #include "mbed.h" #include "string.h" #include "nRF24L01P.h" #include "string.h" BufferedSerial pc_serie(USBTX,USBRX,115200); nRF24L01P my_nrf24l01p(D11, D12, D13, D9, D2, D1); // mosi, miso, sck, csn, ce, irq int main() { #define TRANSFER_SIZE 32 char c; my_nrf24l01p.powerUp(); my_nrf24l01p.setRfFrequency(2418); my_nrf24l01p.setAirDataRate(1000); my_nrf24l01p.setTransferSize( TRANSFER_SIZE ); my_nrf24l01p.setReceiveMode(); my_nrf24l01p.setCrcWidth(0); my_nrf24l01p.setRxAddress(); my_nrf24l01p.enable(); while (1) { if (my_nrf24l01p.readable()) { my_nrf24l01p.read( NRF24L01P_PIPE_P0, &c , 32 ); pc_serie.write(&c,32); } } }