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
Diff: main.cpp
- Revision:
- 5:e0a364225ab5
- Parent:
- 4:47f95dbf49b5
- Child:
- 6:fb9b0e731946
- Child:
- 7:cc8f8fd07dcd
--- a/main.cpp Fri Apr 23 16:14:10 2021 +0000
+++ b/main.cpp Fri Oct 29 08:37:24 2021 +0000
@@ -12,8 +12,8 @@
#include "mbed.h"
#include "nRF24L01P.h"
-
-Serial pc(USBTX, USBRX); // tx, rx
+/* 115200 bit/s */
+Serial pc(USBTX, USBRX); // tx, rx
//Définition des E/S de la liaison SPI vers le module nRF24L01+
nRF24L01P my_nrf24l01p(D11, D12, D13, A3, D9, A0); // mosi, miso, sck, csn, ce, irq
@@ -22,16 +22,15 @@
DigitalOut myled2(D5);
int main()
-{
+{
// Nombre de caractères transmis à chaque envoi
-#define TRANSFER_SIZE 20
+#define TRANSFER_SIZE 1
char txData[TRANSFER_SIZE], rxData[TRANSFER_SIZE];
char caractere_recu=0;
int txDataCnt = 0;
int rxDataCnt = 0;
- int id_robot, v_tangent, v_normale, omega_robot, spiner_bool, v_tir ;
int consigneData[6];
pc.baud(115200); // Débit de la liaison série PC
@@ -40,7 +39,7 @@
my_nrf24l01p.powerUp();
// paramétrage
- my_nrf24l01p.setRfFrequency(2414); // Définition de la fréquence du canal d'E/R
+ my_nrf24l01p.setRfFrequency(2418); // Définition de la fréquence du canal d'E/R
my_nrf24l01p.setAirDataRate(NRF24L01P_DATARATE_1_MBPS); // Définition du débit de la communication RF
my_nrf24l01p.setRfOutputPower(-6);