Problema con la library RF24 per comunicazione Wi-fi
buongiorno, ho provato 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 30720 bytes.
global variables use 217 bytes (10%) of dynamic memory, leaving 1831 bytes local variables. maximum 2048 bytes.
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x61
il codice è questo:
la library sta nella stessa cartella del codice.
qualcuno mi può aiutare capire qual'è il problema?
grazie
arduino: 1.8.5 (windows 10), board: "arduino nano, atmega328p"
sketch uses 3344 bytes (10%) of program storage space. maximum 30720 bytes.
global variables use 217 bytes (10%) of dynamic memory, leaving 1831 bytes local variables. maximum 2048 bytes.
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x61
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x61
il codice è questo:
code: [select]
#include <spi.h> //the communication interface modem
#include "rf24.h" //the library helps control radio modem
//define 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 , 10 digital pin numbers signals ce , csn connected.
const uint64_t pipe = 0xe8e8f0f0e1ll; //the address of modem, receive data arduino.
void setup(void){
serial.begin(9600);
radio.begin(); //it activates modem.
radio.openwritingpipe(pipe); //sets address of receiver program 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 capire qual'è il problema?
grazie
>3drone: ti ricordo che in conformità al regolamento, punto 7, devi editare il tuo post (quindi non scrivendo un nuovo post, ma utilizzando il bottone more -> modify che si trova in basso destra del tuo post) e racchiudere il codice all'interno dei tag code (... sono quelli che in edit inserisce il bottone con icona fatta così: </>, tutto sinistra).
grazie,
guglielmo
grazie,
guglielmo
Arduino Forum > International > Italiano > Software (Moderator: leo72) > Problema con la library RF24 per comunicazione Wi-fi
arduino
Comments
Post a Comment