Buongiorno, ho provato a scaricare su un Arduino Nano il codice per poter trasmettere informazioni via Wi-fi con il NRF24L01. Ho copiato il codice da un video tutorial su youtube solo che mi dà questo messaggio quando clicco upload:
Arduino: 1.8.5 (Windows 10), Board: "Arduino Nano, ATmega328P"
Sketch uses 3344 bytes (10%) of program storage space. Maximum is 30720 bytes.
Global variables use 217 bytes (10%) of dynamic memory, leaving 1831 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x61
Il codice è questo:
#include <SPI.h> //the communication interface with the modem
#include "RF24.h" //the library which helps us to control the radio modem
//define the input pins
int x_axis = A0;
int y_axis = A1;
int potPin = A2;
//define variable values
int xValue;
int yValue;
int potValue;
int data[1];
RF24 radio(5,10); //5 and 10 are a digital pin numbers to which signals CE and CSN are connected.
const uint64_t pipe = 0xE8E8F0F0E1LL; //the address of the modem, that will receive data from Arduino.
void setup(void){
Serial.begin(9600);
radio.begin(); //it activates the modem.
radio.openWritingPipe(pipe); //sets the address of the receiver to which the program will send data.
}
void loop(){
//Send X-axis data
xValue = analogRead(x_axis);
xValue = map(xValue, 0, 1023, 0, 10);
data[0] = xValue;
radio.write(data, 1);
//Send Y-axis data
yValue = analogRead(y_axis);
yValue = map(yValue, 0, 1023, 11, 20);
data[0] = yValue;
radio.write(data, 1);
//Send Potentiometer data
potValue = analogRead(potPin);
potValue = map(potValue, 0, 1023, 21, 30);
data[0] = potValue;
radio.write(data, 1);
}
La library sta nella stessa cartella del codice.
Qualcuno mi può aiutare a capire qual'è il problema?
Grazie