correctif

Dependencies:   mbed RF24Network RF24

Revision:
5:48f3f58ebd13
Parent:
4:c6de6d47c54a
Child:
6:6a3d4e0f6799
--- a/main.cpp	Thu May 20 09:26:58 2021 +0000
+++ b/main.cpp	Thu May 20 09:57:23 2021 +0000
@@ -1,20 +1,26 @@
+/*************************************/
+//  YNCREA ISEN CSI3
+//  Electronique Numérique
+//
+//  Cours : Systèmes à microcontrôleur
+//  Prof : Frédéric Giamarchi
+//
+//  Projet 2021 : Jeu type Simon's pour la rééducation
+//
+//  Note : Utilisation de Timer et du SPI
+/*************************************/
 #include "mbed.h"
 #include <RF24Network.h>
 #include <RF24.h>
-
-Serial pc(USBTX, USBRX);
+#include "isen32_board.h"
 
-DigitalOut LED_V(PA_12);
-DigitalOut LED_J(PB_0);
-DigitalOut LED_R(PB_7);
+Serial pc(USBTX, USBRX);        // 9600 baud par défaut
 
-DigitalIn BP(PA_0);
-
-#define nrf_CE      PA_8
-#define nrf_CSN     PA_11
-#define spi_MOSI    PB_5
-#define spi_MISO    PB_4
-#define spi_SCK     PB_3
+#define nrf_CE      PB_3        // D3 sur connecteur Arduino        
+#define nrf_CSN     PB_12
+#define spi_MOSI    PB_15
+#define spi_MISO    PB_14
+#define spi_SCK     PB_13
 
 RF24 radio(spi_MOSI, spi_MISO, spi_SCK, nrf_CE, nrf_CSN );
 
@@ -57,7 +63,7 @@
 {
     _node node;
        
-    BP.mode(PullUp);    // Resist interne Pull up
+    BTN1.mode(PullUp);    // Resist interne Pull up
 //    pc.baud(9600);
     wait_ms(1000);
 
@@ -72,9 +78,7 @@
     while(1) 
     {
         // Refresh Dels
-        LED_R = node.del & 0x01;
-        LED_J = (node.del & 0x02)>>1;
-        LED_V = (node.del & 0x04)>>2;
+//        Set_8Dels(node.del);
         
         // Pump the network regularly
         network.update();
@@ -116,7 +120,7 @@
             
             node.del = payload_rx.data;
         }
-        if(!BP)
+        if(!BTN1)
         {
             payload_t payload_tx;
             payload_tx.src = this_node;