Come collegare l'arduino nano a Raspberry
Buonasera, provando ad attaccare un arduino nano (https://www.amazon.it/dp/B0716S43Q2?ref ... E_DDE_dt_1) a Raspberry e provando a comandarlo da terminale, mi è sorto un problema ovvero, che dopo avere dato il comando make upload, mi da questo come errore:
e dentro la cartella codice_arduino c'è questo:
ho notato che i due processori non coincidono, se è quello il problema come si potrebbe risolvere?
a proposito, la porta seriale dovrebbe essere quella giusta dato che ho provato a vedere i dispositi collegati senza arduino e con arduino e come porta in più c'era quella.
Grazie mille già in anticipo, buonaserata a tutti.
- Codice: Seleziona tutto
pi@raspberrypi:~/codice_arduino $ make upload
-------------------------
Arduino.mk Configuration:
- [AUTODETECTED] CURRENT_OS = LINUX
- [USER] ARDUINO_DIR = /usr/share/arduino
- [COMPUTED] ARDMK_DIR = /usr/share/arduino (relative to Common.mk)
- [AUTODETECTED] ARDUINO_VERSION = 105
- [DEFAULT] ARCHITECTURE =
- [DEFAULT] ARDMK_VENDOR = arduino
- [DEFAULT] ARDUINO_SKETCHBOOK =
- [BUNDLED] AVR_TOOLS_DIR = /usr/share/arduino/hardware/tools/avr (in Arduino distribution)
- [COMPUTED] ARDUINO_LIB_PATH = /usr/share/arduino/libraries (from ARDUINO_DIR)
- [COMPUTED] ARDUINO_VAR_PATH = /usr/share/arduino/hardware/arduino//variants (from ARDUINO_DIR)
- [COMPUTED] BOARDS_TXT = /usr/share/arduino/hardware/arduino//boards.txt (from ARDUINO_DIR)
- [DEFAULT] USER_LIB_PATH = /libraries (in user sketchbook)
- [DEFAULT] PRE_BUILD_HOOK = pre-build-hook.sh
- [USER] BOARD_TAG = nano
- [COMPUTED] CORE = arduino (from build.core)
- [COMPUTED] VARIANT = eightanaloginputs (from build.variant)
- [COMPUTED] OBJDIR = build-nano (from BOARD_TAG)
- [COMPUTED] ARDUINO_CORE_PATH = /usr/share/arduino/hardware/arduino//cores/arduino (from ARDUINO_DIR, BOARD_TAG and boards.txt)
- [ASSUMED] MONITOR_BAUDRATE = 9600
- [DEFAULT] OPTIMIZATION_LEVEL = s
- [DEFAULT] MCU_FLAG_NAME = mmcu
- [DEFAULT] CFLAGS_STD = -std=gnu11 -flto -fno-fat-lto-objects
- [DEFAULT] CXXFLAGS_STD = -std=gnu++11 -fno-threadsafe-statics -flto
- [COMPUTED] DEVICE_PATH = /dev/ttyUSB0 (from MONITOR_PORT)
- [DEFAULT] FORCE_MONITOR_PORT =
- [AUTODETECTED] Size utility: AVR-aware for enhanced output
- [COMPUTED] BOOTLOADER_PARENT = /usr/share/arduino/hardware/arduino//bootloaders (from ARDUINO_DIR)
- [COMPUTED] ARDMK_VERSION = 1.5
- [COMPUTED] CC_VERSION = 5.4.0 (avr-gcc)
-------------------------
mkdir -p build-nano
make reset
make[1]: ingresso nella directory "/home/pi/codice_arduino"
/usr/bin/ard-reset-arduino /dev/ttyUSB0
make[1]: uscita dalla directory "/home/pi/codice_arduino"
make do_upload
make[1]: ingresso nella directory "/home/pi/codice_arduino"
/usr/share/arduino/hardware/tools/avr/../avrdude -q -V -p atmega168 -C /usr/share/arduino/hardware/tools/avr/../avrdude.conf -D -c arduino -b 19200 -P /dev/ttyUSB0 \
-U flash:w:build-nano/codice_arduino.hex:i
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
avrdude done. Thank you.
make[1]: *** [/usr/share/arduino/Arduino.mk:1462: do_upload] Error 1
make[1]: uscita dalla directory "/home/pi/codice_arduino"
make: *** [/usr/share/arduino/Arduino.mk:1455: upload] Error 2
e dentro la cartella codice_arduino c'è questo:
- Codice: Seleziona tutto
pi@raspberrypi:~/codice_arduino $ ls
build-nano Makefile prova.ino
pi@raspberrypi:~/codice_arduino $ more Makefile
ARDUINO_DIR = /usr/share/arduino
BOARD_TAG = nano
ARDUINO_PORT = /dev/ttyUSB0
ARDUINO_LIBS =
include /usr/share/arduino/Arduino.mk
pi@raspberrypi:~/codice_arduino $ more prova.ino
#define led 5
void setup(){
pinMode(led, OUTPUT);
}
void loop(){
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}
ho notato che i due processori non coincidono, se è quello il problema come si potrebbe risolvere?
a proposito, la porta seriale dovrebbe essere quella giusta dato che ho provato a vedere i dispositi collegati senza arduino e con arduino e come porta in più c'era quella.
Grazie mille già in anticipo, buonaserata a tutti.
