text:
Wrong microcontroller found on Arduino Leonardo
When I try to upload a sketch on this brand new Arduino Leonardo, I get this error:
Arduino: 1.6.11 (Linux), Board: "Arduino Leonardo"

Sketch uses 4,134 bytes (14%) of program storage space. Maximum is 28,672 bytes.
Global variables use 148 bytes (5%) of dynamic memory, leaving 2,412 bytes for local variables. Maximum is 2,560 bytes.

avrdude: Expected signature for ATmega32U4 is 1E 95 87
     Double check chip, or use -F to override this check.
Wrong microcontroller found.  Did you select the right board from the Tools > Board menu?

The output of "Get board info" is
BN: Arduino Leonardo
VID: 2A03
PID: 0036
SN: (null)

This is the actual board

And if I shine a very bright light on che microcontroller, take out my glasses and look veeeeeeery close at it, I can read MEGA32U4. So I think that this is an actual Arduino Leonardo.
I downloaded arduino.org IDE. After compiling ncurses5 (...) and making it starts, now i get this error
Arduino: 1.7.10 (Linux), Board: "Arduino Leonardo"

/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /tmp/build6488251228617422525.tmp/sketch_sep16a.cpp -o /tmp/build6488251228617422525.tmp/sketch_sep16a.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/wiring.c -o /tmp/build6488251228617422525.tmp/wiring.c.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/wiring_digital.c -o /tmp/build6488251228617422525.tmp/wiring_digital.c.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/wiring_analog.c -o /tmp/build6488251228617422525.tmp/wiring_analog.c.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/wiring_shift.c -o /tmp/build6488251228617422525.tmp/wiring_shift.c.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/hooks.c -o /tmp/build6488251228617422525.tmp/hooks.c.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/WInterrupts.c -o /tmp/build6488251228617422525.tmp/WInterrupts.c.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/wiring_pulse.c -o /tmp/build6488251228617422525.tmp/wiring_pulse.c.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/HardwareSerial1.cpp -o /tmp/build6488251228617422525.tmp/HardwareSerial1.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/HardwareSerial0.cpp -o /tmp/build6488251228617422525.tmp/HardwareSerial0.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/USBCore.cpp -o /tmp/build6488251228617422525.tmp/USBCore.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/HardwareSerial2.cpp -o /tmp/build6488251228617422525.tmp/HardwareSerial2.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/main.cpp -o /tmp/build6488251228617422525.tmp/main.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/abi.cpp -o /tmp/build6488251228617422525.tmp/abi.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/HardwareSerial.cpp -o /tmp/build6488251228617422525.tmp/HardwareSerial.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/HardwareSerial3.cpp -o /tmp/build6488251228617422525.tmp/HardwareSerial3.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/WString.cpp -o /tmp/build6488251228617422525.tmp/WString.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/Stream.cpp -o /tmp/build6488251228617422525.tmp/Stream.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/Print.cpp -o /tmp/build6488251228617422525.tmp/Print.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/CDC.cpp -o /tmp/build6488251228617422525.tmp/CDC.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/Tone.cpp -o /tmp/build6488251228617422525.tmp/Tone.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/HID.cpp -o /tmp/build6488251228617422525.tmp/HID.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/WMath.cpp -o /tmp/build6488251228617422525.tmp/WMath.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/IPAddress.cpp -o /tmp/build6488251228617422525.tmp/IPAddress.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=107010 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2a03 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino -I/home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/variants/leonardo /home/phas/Downloads/arduino-1.7.10-linux64/hardware/arduino/avr/cores/arduino/new.cpp -o /tmp/build6488251228617422525.tmp/new.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/wiring.c.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/wiring_digital.c.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/wiring_analog.c.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/wiring_shift.c.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/hooks.c.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/WInterrupts.c.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/wiring_pulse.c.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/HardwareSerial1.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/HardwareSerial0.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/USBCore.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/HardwareSerial2.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/main.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/abi.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/HardwareSerial.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/HardwareSerial3.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/WString.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/Stream.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/Print.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/CDC.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/Tone.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/HID.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/WMath.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/IPAddress.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-ar rcs /tmp/build6488251228617422525.tmp/core.a /tmp/build6488251228617422525.tmp/new.cpp.o
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-gcc -w -Os -Wl,--gc-sections -mmcu=atmega32u4 -o /tmp/build6488251228617422525.tmp/sketch_sep16a.cpp.elf /tmp/build6488251228617422525.tmp/sketch_sep16a.cpp.o /tmp/build6488251228617422525.tmp/core.a -L/tmp/build6488251228617422525.tmp -lm
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /tmp/build6488251228617422525.tmp/sketch_sep16a.cpp.elf /tmp/build6488251228617422525.tmp/sketch_sep16a.cpp.eep
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avr-objcopy -O ihex -R .eeprom /tmp/build6488251228617422525.tmp/sketch_sep16a.cpp.elf /tmp/build6488251228617422525.tmp/sketch_sep16a.cpp.hex

Sketch uses 4,252 bytes (14%) of program storage space. Maximum is 28,672 bytes.
Global variables use 151 bytes (5%) of dynamic memory, leaving 2,409 bytes for local variables. Maximum is 2,560 bytes.
Forcing reset using 1200bps open/close on port /dev/ttyACM0
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {}
Uploading using selected port: /dev/ttyACM0
/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/bin/avrdude -C/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -Uflash:w:/tmp/build6488251228617422525.tmp/sketch_sep16a.cpp.hex:i

avrdude: Version 6.0.1, compiled on Jan 15 2015 at 13:12:29
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/home/phas/Downloads/arduino-1.7.10-linux64/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/phas/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega32U4
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : butterfly
         Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

Might be an Arduino cc vs org kind of thing in the IDE. Check using the IDE from org.

I don't think CC make the Leonardo any more (yes, looking at the site it is "retired"). So it must be a .org board. Maybe you have the wrong programmer selected?

Enable verbose output in the Arduino settings to get a more elaborate error message.

Personally I'd pick the chipKIT Lenny over the Leonardo any day ;)

@MikaelPatel might it be the opposite?

Just by looking at the picture, the silkscreen on the board clearly states ARDUINO.ORG.
It is possible you need to download the IDE from arduino.org (they have their own stupid fork).

Uninstall the modem-manager package in Linux.

@Majenko did that, didn't work. Same error.

@RiccardoCagnasso Damn, worth a try. You might like to check through this and see if there is anything else that may help: https://hackingmajenkoblog.wordpress.com/2016/08/24/diagnosing-arduino-problems-in-linux/

@Majenko nope, nothing useful there. I thoght it would be a permissions problem but nope. I will try it on windows to narrow it down.

I went on windows, i used the arduino.org IDE to flash "Blink" on it and it worked. And them BAM it started working on linux with android.cc IDE.
My knowledge of arduino's internals is limited, but I guess that there was "something" wrong that was overwritten flashing the sketch.
If someone want to elaborate a proper answer from this ...

Since no one has elaborated a better answer: if something like this happens, try to install arduino.org IDE on windows, connect the leonardo and flash a firmware. It should then start to work on any OS.


text:
Connecting Saleae Logic 8 to MISO (pin 12) on Uno 3 w/ NRF24L01+ halts program
I have an NRF24L01+ with the base module (regulates voltage) connected to an Arduino Uno 3.  I'm using the tmrh20 NRF24 library and am running one of the example programs.  I'm trying to sniff the SPI bus so I have a Saleae Logic 8 hooked up.  As soon as I connect the clip to the MISO pin the Arduino program stops executing.  I'm able to reproduce this 100% of the time.  It seems it is only the MISO pin that is causing the problem.  For the library I am using MISO uses pin 12 on the Uno 3.
Anybody know what is going on?  It seems as if the Saleae is grounding pin 12 when I hook it up.  Not sure why it is only pin 12 that is an issue though.
I can reproduce the same problem when I manually connecting pin 12 straight to GND as well.
I can collect samples without MISO just fine but that of course only tells me half the story.
Any suggestions?
EDIT:
Here are some links and resources for more information.
I'm basically following the instructions from this article:
http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
The breakout board
http://www.addicore.com/1x-nRF24L01-Adapter-p/ad279.htm
And it's schematic:

Link to the datasheet for the radio itself:
http://www.nordicsemi.com/eng/Products/2.4GHz-RF/nRF24L01

And some photos of how I have it wired up:

Could you add a link to the NRF24L01+ module you are using and possible schematics? How do you connect ground to the Saleae Logic 8?

Added links.  I connected a few of the ground pins on the Saleae to the ground rail on the breadboard (see photo above).  The ground from the Arduino is connected to the ground rail on the breadboard.

Is the analyzer powered up?  What does that channel read of it read?  Try using a different channel of it.  Also see what size resistor you can connect between the pin and ground without disturbing operation - 100K?  10K?  1K?  Keep in mind your NRF24L01 will only be driving about 3.3v out, an ATmega at 5v has a relatively low Vih for a 5v part, but there won't be as much tolerance for loading as when using a 5v driver.

It seems to be a load issue from the logic analyzer.  I added a pull up resistor between the 5V and the pin.  I still have to have the resistor between the logic analyzer clip and the pin or else it will interfere with execution.  What I see now is that the pin reads high 100% of the time when the clock is not going, and 100% of the time low when the clock is engage.  I don't get any actual values for MISO (0x00 all the time).  The high and low are easily within the logic threshold levels.  I ordered some pots to fine tune the resistors to see if I can find a value that works.  Suggestions?

It would appear from your description that the leads on your logic analyzer distort of the SPI MISO waveform and the Arduino does not read incoming data correctly.
To avoid this, you could place an digital isolator between the Arduino and the Logic 8.
Any decent oscilloscope should also allow you to read the SPI bus.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
What sensor would work for soccer ball detection efficiently using Arduino?
I want to make a soccer goal counter using Arduino and some sensors. I built using an ultrasonic sensor, but it does not detect if the ball is moving too fast. Are there any other sensors I can use to detect soccer ball?

That may not be easy.  You need to detect the ball not the goaltender, so may need to be somewhat back from the line (though this would miss technical but unlikely goals like one that slowly rolls barely over the line and stops).  You need to detect a ball potentially in flight so need a grid or area not a single line.  And you can't false trigger on wind so an instrumented net may be tricky.

I also felt it could be a challenging problem. I tried using ultrasonic sensors, but it does not detect if the ball is too fast. I am not sure modulated IR would work or not considering sunny and windy condition.

This is potentially well beyond the capabilities of a simple MCU like an Arduino UNO. So I think it is very important to clearly define the problem you're trying to solve.
Currently, at top national and international level, video cameras are used to detect a ball crossing the goal line. AFAICT, a lot of the complexity comes from having the goal keeper and several players on the line too. It is important that a player kicking across the goal line is not mistaken for the ball crossing the line. Also, it is important that players bodies can't block the view; a simplistic approach might not be able to see the ball if its kicked between a players legs.
This amounts to (probably) millions of sensors (one per pixel) being monitored at 100+ Hz.
So, I'll assume you are not trying to solve such a complex problem. Instead I'll assume you only want to detect a ball crossing the back edge of the goal line, without considering interference by players.
First, let's gather some numbers to describe the core problem.
A soccer ball/football is at least 68cm in circumference, so it is
68/pi = 21.6cm in diameter, or 0.216m, which is 0.108cm radius.
Then there is the goal. FIFA rules say "The distance between the posts is 7.32 m (8 yds) and the distance from the lower edge of the crossbar to the ground is 2.44 m (8 ft)"
So a question is, must the system detect the ball crossing the goal line at any place?
A goal is about 34 times wider than the diameter of the ball, and
just over 11 times taller. So, if the sensors were some form of 'light beam' being broken, the 'simplest' system would need more than 11 sensors looking horizontally from one goal post to the other.
How fast might the ball travel through the posts? This says Cristiano Ronaldo was measured kicking a ball at 130km/hr. That's 36.1m/s.
So the ball is going to take 0.216/36.1 = 0.006 seconds, 6 milliseconds to pass the back edge of the goal line, ie. front edge to back edge will pass a point in 6 milliseconds. This means the sensors must all be scanned, at worst, every 6 milliseconds.
For a sound based system there are more issues.
How much of the ball is 'seen', ie. if only a small fraction of the ball is 'in view' might the returned sound be too small to register with an off-the-shelf ultrasound sensor? For example, if the angle of the reflected sound is too big, ie. from the front or back of the ball, will enough reflected sound return to the sensor to be detected?
Does the ball reflect sound well? It is a membrane at quite a low excess pressure, very different from a solid wall, so I would guess it isn't a perfect sound reflector. I haven't found anything quantifying this, but it seems reasonable to assume off-the-shelf ultrasound sensors might miss the ball under some circumstances.
So it would seem reasonable to assume that two or more sensor readings of the ball would give a significantly more reliable reading than a single sensor reading.
This equates to sampling at least every 3milliseconds. That is a maximum distance of 0.34m * 3/2millisecons (round trip) = 0.5m (approximately).
This might seem to be too much of a restriction. However, the ultrasound sensor only sends a pulse of a few cycles, so it isn't able to detect the ball for the whole of that 3 milliseconds. I haven't found a spec for the off the shelf sensors, but a plausible assumption might be each pulse lasts for about 10 cycles of 40kHz, so the pulse lasts for 0.25 milliseconds. That is the time the ball might travel, about, 1cm. So the angle of reflection would not change much. Hence trying to detect the ball more frequently will increase the quality of at least one signal.
This may explain why the ball is not always detected using ultrasound sensors in your existing approach.
Using any type of sensors to detect the ball, there is a bit of a trade-off. The ball is round, and so if the sensors are almost at the balls diameter apart, then the sensors are going to need to be scanned more quickly to detect a small part of the ball (think of this as a much smaller ball). On the other hand, if the sensors are much closer so at least one gets a longer 'view' of the ball, then one is going to see something closer to the diameter of the ball, hence see it for longer, and so they could be scanned more slowly.
This adds up to a similar outcome. Increase the number of sensors so one sees the ball for a reasonable length of time, or scan the sensors much faster to have a reasonable chance of a measurement.
A 'classic' way to detect something crossing a plane (a door way or in this case the goal mouth) is with a set of laser beams (think Mission Impossible, Entrapment, etc.).
So, consider eye-safe visible-light laser pointers? They must be eye safe, which AFAIK largely implies visible light lasers as eye-safe partly depends on the eyes 'blink response'.
At the width of a goal, the laser will have spread to several cm, but should still be straightforward to detect. With some care, it might be feasible to use mirrors to reflect a beam back towards the goal post carrying the laser, halving the number of lasers, and keeping all of the wiring on one side. I don't know how many reflections might work, but it is worth experimenting as every reflection reduces the number of lasers and sensors.
One advantage of an optical approach vs sound is the goal mouth could easily be monitored at a much higher rate than the ball could possibly pass.
To discriminate between sunlight, stadium or street lights, or other sources of light, the lasers would be modulated. 5kHz is a common figure, this is well away from mains frequency. The signal should be 'low' when the laser is off, and 'high' when the laser is on. If that isn't the case, then their is signal interference, and it isn't going to work.
With a little bit of electronics at the sensors, the signals may be purely digital, so there would be no reliance on the Arduino's slow ADC; the sensors could be scanned with digital GPIO pins, with, say, all 11 sensors being scanned at 10kHz.
You may be able to achieve a similar effect using narrow angle, high-power LEDs, lenses and tubes. A reasonable lens system should be able to focus LEDs over 7.32m of the goal mouth. However, I think eye-safe laser pointers would work with simpler optics, and the mechanics and optical systems are often harder to make robust than the electronics.
Summary:
A 'raster' of eye-safe, visible-light lasers, at approximately 10cm apart, maybe with mirrors to significantly reduce the number of lasers and sensors, directed horizontally across the goal mouth, could detect a ball passing.
However, it would be confused by players across the goal line.

You should be able to detect an object as large as a soccer ball with an array of modulated IR transmitters and receivers.  However you might want to avoid using IR receivers like the ones found in entertainment equipment.  These have an AGC stage which will, when blocked, turn up the gain until the receiver finds a weak indirect signal.  Instead, try searching using "Long-Range Presence and Proximity Sensors".

Great. Thanks. But, will it work in sunlight too? IR modulated Tx-Rx should be co-planar in windy condition too, which is difficult. Proximity sensors work fine for slow balls. If the ball is moving very fast, they miss sometimes. I like the idea of using modulated IR, but I am only worried about the distance. It should work fine if I place them 3 meters apart! Will it? How many modulated IR will work to create the grid?

Most of the sensors I have see are modulated at 38KHz.  That should take care of some of the sunlight interference.   But most of the applications, admittedly, are indoors.  You might need to take care and place the receiver in a black tube to shield it from sunlight.  Also, you probably need to mount the transmitters and detectors on the ridged part of the soccer goal frame.  The municipal goals I have seen are super sturdy welded metal frames.  Lenses might help but will be a bother to assemble.  You might investigate COTS parts such as Garage Door Beam Interrupters.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Can't POST data with Arduino and ESP8266
I'm having problems with my Arduino UNO and the ESP8266 module.
I need to send values from Arduino to my PHP web page in this way:
http://www.server.com/km/db.php?id=53
the ESP8266 module is working fine, it powers up and connects to my Wi-Fi without problems, but I'm not able to send the values to my PHP page.
This is my code:
    #include "SoftwareSerial.h"

String ssid ="NETGEAR80";
String password="mypassword";

SoftwareSerial esp(10, 11);// RX, TX

String data;

String server = "http://www.server.com";
String uri = "/km/db.php";//
int DHpin = 8;//sensor pin
byte dat [5];
String temp ,hum;

void setup() {
pinMode (DHpin, OUTPUT);
esp.begin(9600);
Serial.begin(9600);
reset();
connectWifi();

}

void reset() {
esp.println("AT+CWMODE_DEF=1");
esp.println("AT+RST");
delay(1000);
if(esp.find((char*)"OK") ) Serial.println("Module Reset");

}

void connectWifi() {
Serial.println("Collegamento");
String cmd = "AT+CWJAP_CUR=\"" +ssid+"\",\"" + password + "\"";
esp.println(cmd);
Serial.println(cmd);
delay(4000);
if(esp.find((char*)"OK")) {
Serial.println("Connected!");
}
else {
connectWifi();
Serial.println("Cannot connect to wifi"); }
}

void loop () {

temp=11;

data = "id=" + temp;// data sent must be under this form

httppost();

delay(1000);

}

void httppost () {

esp.println("AT+CIPSTART=\"TCP\",\"" + server + "\",80");//start a TCP connection.
if( esp.find((char*)"OK")) {
Serial.println("TCP connection ready");
} delay(1000);

String postRequest =
"POST " + uri + " HTTP/1.0\r\n" + "Host: " + server + "\r\n" + "Accept: *" + "/" + "*\r\n" + "Content-Length: " + data.length() + "\r\n" + "Content-Type: application/x-www-form-urlencoded\r\n" + "\r\n" + data;

Serial.println(postRequest);

String sendCmd = "AT+CIPSEND=";//determine the number of caracters to be sent.

esp.print(sendCmd);

esp.println(postRequest.length() );

delay(500);

if(esp.find((char*)">")) { Serial.println("Sending.."); esp.print(postRequest);

if(esp.find((char*)"SEND OK")) { Serial.println("Packet sent");

while (esp.available()) {

String tmpResp = esp.readString();

Serial.println(tmpResp);

}

// close the connection

esp.println("AT+CIPCLOSE");

}

}
}

This is the output on the Serial Terminal:
Module Reset
Collegamento
AT+CWJAP_CUR="NETGEAR80","calmgrasshopper675"
In attesa..
Connected!
POST /km/db.php HTTP/1.0
Host: www.skeetty.com
Accept: */*
Content-Length: 17
Content-Type: application/x-www-form-urlencoded

id=11&humidity=10
POST /km/db.php HTTP/1.0
Host: www.skeetty.com
Accept: */*
Content-Length: 17
Content-Type: application/x-www-form-urlencoded

The code works fine till the POST, but then no answer is received.
This condition:
if(esp.find((char*)">")) { Serial.println("Sending.."); esp.print(postRequest);

is never verified.
I can't understand if there is something wrong with the POST format, with the URL or something else.
Can you help me, please?

EDIT 26/04/2019
This is the output if I manually write the AT commands directly to the ESP8266 module through the Serial Monitor.
AT+CWJAP="NETGEAR80","my_password"

WIFI CONNECTED
WIFI GOT IP

OK
AT+CIPMUX=1

OK

AT+CIPSTART=1,"TCP","www.server.com",80

1,CONNECT

OK

If I use the Arduino code, it never connects to the server and the string "TCP connection ready" do not show, so I think it is not able to correctly connect to the server. Maybe, it's for a formatting error? I can't find the reason.

EDIT2 with @Juraj code.
    #include <SoftwareSerial.h>

SoftwareSerial Serial1(10, 11);
#define Trash "Trash3"
#define DHTTYPE DHT11
#define DHTPIN 2
#define TRIGGER_PIN 4
#define ECHO_PIN 3

float humidity, temp_f;
int distance;
long duration;

String buff(64);
String getStr(128);

void setup() {

Serial.begin(9600);

Serial1.begin(9600);
//Serial1.resetESP();
delay(2000);
Serial1.setTimeout(5000);

if (!connectWiFi()) {
Serial.println("Can not connect to the WiFi.");
while (true)
; // do nothing
}
Serial.println("OK, Connected to WiFi.");

sendCommand("AT+CIPSTA?");
sendCommand("AT+CIPDNS_CUR?");
sendCommand("AT+CIPSTAMAC?");
}

void loop() {

temp_f = 11;

// connect to server
if (sendCommand("AT+CIPSTART=\"TCP\",\"www.skeetty.com\",80")) {
Serial.println("connected to Cloud");

// build HTTP request
getStr = "GET /km/db.php?id=";
getStr += temp_f;
getStr += " HTTP/1.1\r\n";
getStr += "Host: expository-spoke.000webhostapp.com\r\n\r\n";

// open send buffer
buff = "AT+CIPSEND=";
buff += getStr.length();
if (sendCommand(buff.c_str()) && Serial1.find(">")) { // AT firmware is ready to accept data

// send HTTP request
Serial.println(getStr);
Serial1.print(getStr);

// print HTTP response
if (Serial1.find("+IPD,")) { // response received
int l = Serial1.parseInt();
while (l > 0) {
if (Serial1.available()) {
Serial.write(Serial1.read());
l--;
}
}
Serial.println("--------------");
} else {
Serial.println("no response");
}
} else {
Serial.println("send error");
}
sendCommand("AT+CIPCLOSE");
} else {
Serial.println("Error connecting");
}
}

bool connectWiFi() {

if (!sendCommand("ATE0")) // echo off
return false;
if (!sendCommand("AT+CIPMUX=0")) // set single connection mode
return false;
if (!sendCommand("AT+CWMODE=1")) // set STA mode
return false;
return sendCommand("AT+CWJAP=\"NETGEAR80\",\"calmgrasshopper675\"");
}

bool sendCommand(const char* cmd) {
Serial.println(cmd);
Serial1.println(cmd);
while (true) {
buff = Serial1.readStringUntil('\n');
buff.trim();
if (buff.length() > 0) {
Serial.println(buff);
if (buff == "OK" || buff == "SEND OK" || buff == "ALREADY CONNECTED")
return true;
if (buff == "ERROR" || buff == "FAIL" || buff == "SEND FAIL")
return false;
}
}
}

it never connects to the Wi-Fi network because sendCommand() always return false.

Comments are not for extended discussion; this conversation has been moved to chat.

Did you solve it? How?

No, I didnt solve it so I changed my hardware.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Read encoder output by using an optocoupler
I have a 512 pulses encoder with four wires: +5V, ChannelA, ChannelB, GND and I'm using it as feedback for my motor position (max 80 RPM) on Arduino UNO. Everything works fine, but I need also to generate a +5V signal everytime ChannelA is HIGH since I need to use it to trigger further actions.
I was thinking to read ChannelA by using an optocoupler in order to split the signal and use it both for feedback and for the +5V signal. Is it possible?
Is there any other easier solution to do that?
EDIT: I try to explain better what the additional device must do.
The device is a video camera system that takes a +5V signal from the encoder to trigger some actions by software (create key frames or more) and we need it for our computer vision system. I just need to use the encoders both for the motor feedback and to trigger the video camera. The signal is always +5V so I do not have problems with voltage levels. What do you suggest? I do not have to drive loads from channelA output, I just need the +5V signal to trigger the video camera.
Can I split the channelA output and use it both for the motor controller and the video camera inputs?
EDIT2:
Following the useful suggestions of @st2000 I tried to think to a solution like this:

Do you think it can work?
EDIT3: I changed swapped the motor controller and the video system positions in the circuit and I changed the voltage source from +12VDC to +5VDC for the motor controller since it accepts only +5V signals as input.

EDIT4: Following the suggestions of @st2000, I changed the circuit design by placing in parallel both devices (motor controller and video system) by using the optocoupler (6N136) only for the video output to isolate it from the whole system.

Possible, yes. But you may get it easier. For what do you need that 5V signal from channel A?

Can't you just split the channelA encoder output, to go to both the Arduino and your other mystery device? Please tell us more about what it is you are trying to do, and what the actual problem is.

Thank you for all your assistance! The mistery device is a video camera system that takes a +5V signal from the encoder to trigger some actions by software (create key frames or more) and we need it for our computer vision system. I just need to use the encoders both for the motor feedback and to trigger the video camera. The signal is always +5V so I do not have problems with voltage levels. What do you suggest?

A few things, people don't usually design circuits here, this site is designed to build a database of clear questions and concise answers.  It needs to be searchable so questions are encouraged to be specific.  For instance it would be better if you spread these questions out in individual posts. In general, if other people can not use your question and any ensuing answer, it is not a good fit for the many stackexchange sites.

That said, I would clean your post of unnecessary schematics leaving only the last one.  We can work off that one.  But keep in mind my answers are going to be general to keep within the guide lines of stackexchange sites and may not work for your particular case.  In other words by no means should you assume we will create a working circuit.  The intent is to suggest some methods used my some to help design a circuit.

A simple cheat is to place the LEDs of the two opto couplers in series and then modify the current limit resistor to bring the current back to where it should be.

People sometimes use optical couplers when anticipating large voltage differences or the potential for large voltage differences.  This may always be the case as in a light dimmer.  Or may preventative as in ground loop mitigation for MIDI connections.  If you anticipate these types of situations then an optical coupler may be a good design choice.
Alternatively if the signal is changing between 0 volts and 5 volts and the fan out of the signal is larger then the existing load and the new load combined and the new load is 5 volt tolerant then the signal might be able to drive both loads.
You might seek out the specifications of the 3 connected devices in question.  At the very least, discover the current the encoder output will support.  Then measure the resistance to ground of the input to the motor controller and the resistance to ground of the input to the video equipment.  Find the parallel resistance of these two resistance and calculate the current at 5 volts.  If the current is substantially less then the specified capacity of the encoder, the encoder might be able to drive the 2 loads.  This assumes many things such as no ground loops being present.  There are so many variable it is difficult to be predict the outcome.

The fan out is very limited, I just need to catch the +5V signal to trigger some events on my video camera system so I do not have to drive high loads. The video camera system is 5V tolerant.

Thank you for making your question more complete.  It is still a mystery what is inside the video equipment.  It may be a high impedance device like a MOSFET with a load resistor to ground to mitigate noise problems.  But that is just a guess.  Also, your video equipment may be only inches away.  Or may be across the lab.  Logic level signals can be adversely affected by long wires.  This is turning into a complex problem.

I can't check what's inside the video system unfortunately. For sure, the maximum distance between the encoder and the video system is 100 cm. In case it has a high impedance, what would be a possible solution? I think we have to check the worst case..

Hi @MarcusBarnet, we are getting into a situation where we can not assure success. It is at these point I start to consider what risks I am willing to take verses the effort to discover everything about everything involved.  For example I would ask myself how much would a new encoder cost if the current one failed. Keep in mind you are asking this question in the Arduino forum where parts very rarely cost more then $50. That said, 1 meter isn't that long in a quiet environment.  Did have a prof w/a pulsing ruby laser in a lab once. That didn't go well. Hi impedance isn't a bad thing ...

... unless there's a lot of noise. Guessing, what I would do is to make sure there are no ground loops.  That can blow out connected devices quickly.  Make sure the input impedance to ground is high for both loads.  Scope the output of the encoder w/no load.  Scope it w/the motor controller only.  Scope it w/the video equipment only.  If both look good then connect them both and verify the signal from the encoder still looks good.  If you are iffy about doing this, then I would suggest you find a tech or eng that is more familiar w/your setup who can do this for you.

Thank you for your support! Can't I just use an opto coupler to pick up the signal from the encoder output? I'm asking this because I think this should be very safe. My only doubt is if the optocoupler is faster enough to catch the encoder output..

It is likely the optical coupler will be fast enough.  The challenge is using an optical coupler.  You likely need a series resistance between the output of the encoder and the LED inside the optical coupler.  Then, you likely need to arrange the output of the optical coupler similar to an open collector output and pull the output high through another resistor. Possibly something like this.

I already have several 6N136 optocouplers (https://www.enovatera.com/5471-thickbox_default/enovatera-6n136-opto-isolator-with-transistor-output-discount-price-buy-6n136.jpg) in my laboratory, can I use one of them? I thought to use it in this way: http://www.robo-dyne.com/pics/circuit-encoder.png can it be correct?

As this isn't a forum we'll eventually pass a threshold and the web site will ask us to move this discussion to a different page.  Looking at the optical coupler specifications here I see where pin 3 is connected to ground. It is more likely the motor controller should be connected to the encoder output instead.

Thank you @st2000 for your support! as you suggested, I swapped the motor controller position with the video system output and I changed the voltage source for the motor controller to +5VDC instead of +12VDC (http://www.robo-dyne.com/pics/circuit-encoder1.png). Do you think the 10K resistor and the 320R are correct? I used this same circuit to drive a MOSFET and it worked fine.

I wasn't clear.  And sorry for all the qualifiers but with out knowledge of all connected devices this is just guess work.  It may be the best approach is to split the signal from the encoder to both the motor driver and video equipment. in parallel not in series.  R15: Look at the 6N136 spec for normal input voltage & current and calculate R.   270 ohms looks a bit high.  R14: 10K ohms may work but only if the input of the video equipment is many times that resistance.  No where in  your descriptions do you mention a 12 volt signal.  So likely you shouldn't have one in your schematic.

Thank you again for your support! The 12V was a type related to my old design, the main voltage is 5V. If I split the signal to both motor driver and video system I do not have to use the optocoupler, is it correct? I was thinking to change the previous circuit by placing both devices in parallel, but using the optocoupler for the video output. Do you think it can make sense? http://www.robo-dyne.com/pics/circuit-encoder2.png (I'll check the datasheet for the correct value of 270R resistor)


text:
Error compiling arduino sketch to seeduino xiao for RF24 Module
I am trying to get 2 rf24 modules talking to each other. This is my first real arduino project so bear with my ignorance please.  I could get them to work with 2 arduino nano but, when trying to upload the same sketch to a seeduino xiao it won't compile. Not sure how to format this better (please intstruct) sorry<-- Here is a copy of the error message:
Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Seeeduino XIAO, Arduino, On"

In file included from C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:9:0:

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/adc.h:684:34: note: in expansion of macro 'STATUS'

   __I  ADC_STATUS_Type           STATUS;      /**< \brief Offset: 0x19 (R/   8) Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/dac.h:277:34: note: in expansion of macro 'STATUS'

   __I  DAC_STATUS_Type           STATUS;      /**< \brief Offset: 0x7 (R/   8) Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/eic.h:667:34: note: in expansion of macro 'STATUS'

   __I  EIC_STATUS_Type           STATUS;      /**< \brief Offset: 0x01 (R/   8) Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:26:21: error: expected unqualified-id before numeric constant

 #define CONFIG      0x00

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/eic.h:675:34: note: in expansion of macro 'CONFIG'

   __IO EIC_CONFIG_Type           CONFIG[2];   /**< \brief Offset: 0x18 (R/W 32) Configuration n */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/gclk.h:301:34: note: in expansion of macro 'STATUS'

   __I  GCLK_STATUS_Type          STATUS;      /**< \brief Offset: 0x1 (R/   8) Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/nvmctrl.h:346:34: note: in expansion of macro 'STATUS'

   __IO NVMCTRL_STATUS_Type       STATUS;      /**< \brief Offset: 0x18 (R/W 16) Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/rtc.h:1000:34: note: in expansion of macro 'STATUS'

   __IO RTC_STATUS_Type           STATUS;      /**< \brief Offset: 0x0A (R/W  8) Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/rtc.h:1020:34: note: in expansion of macro 'STATUS'

   __IO RTC_STATUS_Type           STATUS;      /**< \brief Offset: 0x0A (R/W  8) Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/rtc.h:1042:34: note: in expansion of macro 'STATUS'

   __IO RTC_STATUS_Type           STATUS;      /**< \brief Offset: 0x0A (R/W  8) Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/sercom.h:1419:34: note: in expansion of macro 'STATUS'

   __IO SERCOM_I2CM_STATUS_Type   STATUS;      /**< \brief Offset: 0x1A (R/W 16) I2CM Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/sercom.h:1441:34: note: in expansion of macro 'STATUS'

   __IO SERCOM_I2CS_STATUS_Type   STATUS;      /**< \brief Offset: 0x1A (R/W 16) I2CS Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/sercom.h:1463:34: note: in expansion of macro 'STATUS'

   __IO SERCOM_SPI_STATUS_Type    STATUS;      /**< \brief Offset: 0x1A (R/W 16) SPI Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/sercom.h:1488:34: note: in expansion of macro 'STATUS'

   __IO SERCOM_USART_STATUS_Type  STATUS;      /**< \brief Offset: 0x1A (R/W 16) USART Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/tc.h:621:34: note: in expansion of macro 'STATUS'

   __I  TC_STATUS_Type            STATUS;      /**< \brief Offset: 0x0F (R/   8) Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/tc.h:645:34: note: in expansion of macro 'STATUS'

   __I  TC_STATUS_Type            STATUS;      /**< \brief Offset: 0x0F (R/   8) Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/tc.h:667:34: note: in expansion of macro 'STATUS'

   __I  TC_STATUS_Type            STATUS;      /**< \brief Offset: 0x0F (R/   8) Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/tcc.h:253:14: note: in expansion of macro 'STATUS'

     uint32_t STATUS:1;         /*!< bit:      3  Status Busy                        */

              ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/tcc.h:1799:34: note: in expansion of macro 'STATUS'

   __IO TCC_STATUS_Type           STATUS;      /**< \brief Offset: 0x30 (R/W 32) Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/usb.h:1728:34: note: in expansion of macro 'STATUS'

   __I  USB_DEVICE_STATUS_Type    STATUS;      /**< \brief Offset: 0x00C (R/   8) DEVICE Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/usb.h:1759:34: note: in expansion of macro 'STATUS'

   __IO USB_HOST_STATUS_Type      STATUS;      /**< \brief Offset: 0x00C (R/W  8) HOST Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:26:21: error: expected unqualified-id before numeric constant

 #define CONFIG      0x00

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/wdt.h:290:34: note: in expansion of macro 'CONFIG'

   __IO WDT_CONFIG_Type           CONFIG;      /**< \brief Offset: 0x1 (R/W  8) Configuration */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\nRF24L01.h:33:21: error: expected unqualified-id before numeric constant

 #define STATUS      0x07

                     ^

C:\Users\User\Documents\ArduinoData\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/samd21/include/component/wdt.h:296:34: note: in expansion of macro 'STATUS'

   __I  WDT_STATUS_Type           STATUS;      /**< \brief Offset: 0x7 (R/   8) Status */

                                  ^~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::print_status(uint8_t)':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:188:22: error: '_BV' was not declared in this scope

            (status & _BV(RX_DR))?1:0,

                      ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:188:22: note: suggested alternative: '_B'

            (status & _BV(RX_DR))?1:0,

                      ^~~

                      _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:186:3: error: 'printf_P' was not declared in this scope

   printf_P(PSTR("STATUS\t\t = 0x%02x RX_DR=%x TX_DS=%x MAX_RT=%x RX_P_NO=%x TX_FULL=%x\r\n"),

   ^~~~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:186:3: note: suggested alternative: 'sprintf_P'

   printf_P(PSTR("STATUS\t\t = 0x%02x RX_DR=%x TX_DS=%x MAX_RT=%x RX_P_NO=%x TX_FULL=%x\r\n"),

   ^~~~~~~~

   sprintf_P

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::print_observe_tx(uint8_t)':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:200:3: error: 'printf_P' was not declared in this scope

   printf_P(PSTR("OBSERVE_TX=%02x: POLS_CNT=%x ARC_CNT=%x\r\n"),

   ^~~~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:200:3: note: suggested alternative: 'sprintf_P'

   printf_P(PSTR("OBSERVE_TX=%02x: POLS_CNT=%x ARC_CNT=%x\r\n"),

   ^~~~~~~~

   sprintf_P

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::print_byte_register(const char*, uint8_t, uint8_t)':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:212:3: error: 'printf_P' was not declared in this scope

   printf_P(PSTR(PRIPSTR"\t%c ="),name,extra_tab);

   ^~~~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:212:3: note: suggested alternative: 'sprintf_P'

   printf_P(PSTR(PRIPSTR"\t%c ="),name,extra_tab);

   ^~~~~~~~

   sprintf_P

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::print_address_register(const char*, uint8_t, uint8_t)':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:223:3: error: 'printf_P' was not declared in this scope

   printf_P(PSTR(PRIPSTR"\t%c ="),name,extra_tab);

   ^~~~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:223:3: note: suggested alternative: 'sprintf_P'

   printf_P(PSTR(PRIPSTR"\t%c ="),name,extra_tab);

   ^~~~~~~~

   sprintf_P

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::printDetails()':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:325:3: error: 'printf_P' was not declared in this scope

   printf_P(PSTR("Data Rate\t = %S\r\n"),pgm_read_word(&rf24_datarate_e_str_P[getDataRate()]));

   ^~~~~~~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:325:3: note: suggested alternative: 'sprintf_P'

   printf_P(PSTR("Data Rate\t = %S\r\n"),pgm_read_word(&rf24_datarate_e_str_P[getDataRate()]));

   ^~~~~~~~

   sprintf_P

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::begin()':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:382:25: error: '_BV' was not declared in this scope

   write_register(STATUS,_BV(RX_DR) | _BV(TX_DS) | _BV(MAX_RT) );

                         ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:382:25: note: suggested alternative: '_B'

   write_register(STATUS,_BV(RX_DR) | _BV(TX_DS) | _BV(MAX_RT) );

                         ^~~

                         _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::startListening()':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:398:50: error: '_BV' was not declared in this scope

   write_register(CONFIG, read_register(CONFIG) | _BV(PWR_UP) | _BV(PRIM_RX));

                                                  ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:398:50: note: suggested alternative: '_B'

   write_register(CONFIG, read_register(CONFIG) | _BV(PWR_UP) | _BV(PRIM_RX));

                                                  ^~~

                                                  _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::powerDown()':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:429:50: error: '_BV' was not declared in this scope

   write_register(CONFIG,read_register(CONFIG) & ~_BV(PWR_UP));

                                                  ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:429:50: note: suggested alternative: '_B'

   write_register(CONFIG,read_register(CONFIG) & ~_BV(PWR_UP));

                                                  ^~~

                                                  _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::powerUp()':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:436:49: error: '_BV' was not declared in this scope

   write_register(CONFIG,read_register(CONFIG) | _BV(PWR_UP));

                                                 ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:436:49: note: suggested alternative: '_B'

   write_register(CONFIG,read_register(CONFIG) | _BV(PWR_UP));

                                                 ^~~

                                                 _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'bool RF24::write(const void*, uint8_t)':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:468:25: error: '_BV' was not declared in this scope

   while( ! ( status & ( _BV(TX_DS) | _BV(MAX_RT) ) ) && ( millis() - sent_at < timeout ) );

                         ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:468:25: note: suggested alternative: '_B'

   while( ! ( status & ( _BV(TX_DS) | _BV(MAX_RT) ) ) && ( millis() - sent_at < timeout ) );

                         ^~~

                         _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::startWrite(const void*, uint8_t)':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:510:52: error: '_BV' was not declared in this scope

   write_register(CONFIG, ( read_register(CONFIG) | _BV(PWR_UP) ) & ~_BV(PRIM_RX) );

                                                    ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:510:52: note: suggested alternative: '_B'

   write_register(CONFIG, ( read_register(CONFIG) | _BV(PWR_UP) ) & ~_BV(PRIM_RX) );

                                                    ^~~

                                                    _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'bool RF24::available(uint8_t*)':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:552:28: error: '_BV' was not declared in this scope

   bool result = ( status & _BV(RX_DR) );

                            ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:552:28: note: suggested alternative: '_B'

   bool result = ( status & _BV(RX_DR) );

                            ^~~

                            _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'bool RF24::read(void*, uint8_t)':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:585:39: error: '_BV' was not declared in this scope

   return read_register(FIFO_STATUS) & _BV(RX_EMPTY);

                                       ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:585:39: note: suggested alternative: '_B'

   return read_register(FIFO_STATUS) & _BV(RX_EMPTY);

                                       ^~~

                                       _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::whatHappened(bool&, bool&, bool&)':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:594:42: error: '_BV' was not declared in this scope

   uint8_t status = write_register(STATUS,_BV(RX_DR) | _BV(TX_DS) | _BV(MAX_RT) );

                                          ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:594:42: note: suggested alternative: '_B'

   uint8_t status = write_register(STATUS,_BV(RX_DR) | _BV(TX_DS) | _BV(MAX_RT) );

                                          ^~~

                                          _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::openReadingPipe(uint8_t, uint64_t)':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:652:57: error: '_BV' was not declared in this scope

     write_register(EN_RXADDR,read_register(EN_RXADDR) | _BV(pgm_read_byte(&child_pipe_enable[child])));

                                                         ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:652:57: note: suggested alternative: '_B'

     write_register(EN_RXADDR,read_register(EN_RXADDR) | _BV(pgm_read_byte(&child_pipe_enable[child])));

                                                         ^~~

                                                         _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::enableDynamicPayloads()':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:671:51: error: '_BV' was not declared in this scope

   write_register(FEATURE,read_register(FEATURE) | _BV(EN_DPL) );

                                                   ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:671:51: note: suggested alternative: '_B'

   write_register(FEATURE,read_register(FEATURE) | _BV(EN_DPL) );

                                                   ^~~

                                                   _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::enableAckPayload()':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:700:51: error: '_BV' was not declared in this scope

   write_register(FEATURE,read_register(FEATURE) | _BV(EN_ACK_PAY) | _BV(EN_DPL) );

                                                   ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:700:51: note: suggested alternative: '_B'

   write_register(FEATURE,read_register(FEATURE) | _BV(EN_ACK_PAY) | _BV(EN_DPL) );

                                                   ^~~

                                                   _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::setAutoAck(uint8_t, bool)':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:770:16: error: '_BV' was not declared in this scope

       en_aa |= _BV(pipe) ;

                ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:770:16: note: suggested alternative: '_B'

       en_aa |= _BV(pipe) ;

                ^~~

                _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:774:17: error: '_BV' was not declared in this scope

       en_aa &= ~_BV(pipe) ;

                 ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:774:17: note: suggested alternative: '_B'

       en_aa &= ~_BV(pipe) ;

                 ^~~

                 _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::setPALevel(rf24_pa_dbm_e)':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:799:14: error: '_BV' was not declared in this scope

   setup &= ~(_BV(RF_PWR_LOW) | _BV(RF_PWR_HIGH)) ;

              ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:799:14: note: suggested alternative: '_B'

   setup &= ~(_BV(RF_PWR_LOW) | _BV(RF_PWR_HIGH)) ;

              ^~~

              _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'rf24_pa_dbm_e RF24::getPALevel()':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:832:46: error: '_BV' was not declared in this scope

   uint8_t power = read_register(RF_SETUP) & (_BV(RF_PWR_LOW) | _BV(RF_PWR_HIGH)) ;

                                              ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:832:46: note: suggested alternative: '_B'

   uint8_t power = read_register(RF_SETUP) & (_BV(RF_PWR_LOW) | _BV(RF_PWR_HIGH)) ;

                                              ^~~

                                              _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'bool RF24::setDataRate(rf24_datarate_e)':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:864:14: error: '_BV' was not declared in this scope

   setup &= ~(_BV(RF_DR_LOW) | _BV(RF_DR_HIGH)) ;

              ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:864:14: note: suggested alternative: '_B'

   setup &= ~(_BV(RF_DR_LOW) | _BV(RF_DR_HIGH)) ;

              ^~~

              _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'rf24_datarate_e RF24::getDataRate()':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:907:43: error: '_BV' was not declared in this scope

   uint8_t dr = read_register(RF_SETUP) & (_BV(RF_DR_LOW) | _BV(RF_DR_HIGH));

                                           ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:907:43: note: suggested alternative: '_B'

   uint8_t dr = read_register(RF_SETUP) & (_BV(RF_DR_LOW) | _BV(RF_DR_HIGH));

                                           ^~~

                                           _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::setCRCLength(rf24_crclength_e)':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:933:47: error: '_BV' was not declared in this scope

   uint8_t config = read_register(CONFIG) & ~( _BV(CRCO) | _BV(EN_CRC)) ;

                                               ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:933:47: note: suggested alternative: '_B'

   uint8_t config = read_register(CONFIG) & ~( _BV(CRCO) | _BV(EN_CRC)) ;

                                               ^~~

                                               _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'rf24_crclength_e RF24::getCRCLength()':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:957:46: error: '_BV' was not declared in this scope

   uint8_t config = read_register(CONFIG) & ( _BV(CRCO) | _BV(EN_CRC)) ;

                                              ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:957:46: note: suggested alternative: '_B'

   uint8_t config = read_register(CONFIG) & ( _BV(CRCO) | _BV(EN_CRC)) ;

                                              ^~~

                                              _B

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp: In member function 'void RF24::disableCRC()':

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:974:46: error: '_BV' was not declared in this scope

   uint8_t disable = read_register(CONFIG) & ~_BV(EN_CRC) ;

                                              ^~~

C:\Users\User\Documents\Arduino\libraries\RF24-master\RF24.cpp:974:46: note: suggested alternative: '_B'

   uint8_t disable = read_register(CONFIG) & ~_BV(EN_CRC) ;

                                              ^~~

                                              _B

Multiple libraries were found for "nRF24L01.h"

 Used: C:\Users\User\Documents\Arduino\libraries\RF24-master

 Not used: C:\Users\User\Documents\Arduino\libraries\NRFLite

exit status 1

Error compiling for board Seeeduino XIAO.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I suspect I have multiple problems as it took a lot of playing around with the libraries to get the RF24-Master library to work. I may have messed that up somehow (but it was working with the Nano...so...??).
Here is a copy of the sketch being loaded:
[code]
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
int DataMgs[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE14BC8F482LL;
int Relay1 = 5;
void setup()
{
pinMode(Relay1, OUTPUT);
Serial.begin(57600);
radio.begin();
radio.openReadingPipe(1,pipe);
radio.startListening();
}
void loop()
{
if (radio.available())
{
bool done = false;
while (!done)
{
done = radio.read(DataMgs, 1);
Serial.print("NRF24L01 Receiver: ");
Serial.println(DataMgs[0]);
  if (DataMgs[0] == 1)
  {
    delay(10);
    digitalWrite(Relay1, HIGH);
  }

  if (DataMgs[0] == 2)
  {
    delay(10);digitalWrite(Relay1, LOW);
  }
  delay(100);
}

}
else
{
Serial.println("Waiting for signal...");
}
}
[/code]
Any guidance would be greatly appreciated. Thanks
P.S. If anyone can guide me through this issue I can send some crypto your way- thanks again.


text:
What is the difference between SCLK and CLK pins?
Please do forgive me if anything in this question does not make sense, I am very new to PCB and Arduino.
I am following a tutorial through where the person doing it is making a small data computer (for a balloon or drone, I don't know) on Eagle By Autodesk. I am on a part of the tutorial where an SD & MMC card reader is being used. The instuctor is using a library he has made himself, whilst I am using the default Adafruit library. On his library for the SD card reader, he has a CLK pin, however on the default Adafruit library there is the SCLK pin.
Is there a difference between SCLK pins and CLK pins? And am I ok just to use the CLK pin?
Thank you very much :)

Which Arduino board are you using?

@sempaiscuba The Teensy 3.2 (it's not technically an Arduino).

Ah.  Just that you tagged your question as arduino-uno, which doesn't have either an SCLK or a CLK pin.

@sempaiscuba yeah sorry, my bad

"CLK" stands for "CLocK". "S" stands for "Serial". So "SCLK" is "Serial CLocK". You also get "SCL" (often used for I2C) and "SCK" meaning the same thing.
An SD card has multiple modes of communication: serial, or 4-bit parallel (called SDIO). A clock is a clock whether it is used for serial or parallel communication. What you call it doesn't really matter, at best it just gives a hint about what kind of communication it is used for.
It's like some people use MOSI/MISO and some use SDO/SDI, or DO/DI. There's no standard. It's just data moving one way, data moving the other, and some form of clock to keep it all together.

Well they both are clock pin, but on an arduino uno the sclk pin may refer to the spi clock pin while the clk may refer to the i2c clock pin. I2C and SPI are two communication protocols. So if you know which one you're using take action with the corresponding pins.
I Think the best would be for you to share the tutorial you are following and the place in the code you dont underst

Though with I2C the clock pin is commonly called SCL. So again another version of these similar abbreviations.


text:
Arduino to read from RS232 converter to TTL serial module (updated)
Here's the system I want to work on:

The weight controller device detects weight which can transfer data via RS232 serial connection
I used RS232 converter to TTL serial module to connect the weight controller device to Arduino
The TTL connections were made to respective pins of Arduino UNO Board (GND-GND, VCC-5V, RX-0, TX-1)

The serial print from serial connection should produce 17 character length string : ST,GS    1.58,kg
Why am I getting strange results at times?
// Read Serial (RS232) data from Weight Controller Device via RS232 to TTL Converter Module

// Ignore the include statement, the editor does not allow pasting certain characters

include SoftwareSerial.h

int RX_PIN = 2;
int TX_PIN = 3;
int BAUD_IDE = 9600;
int BAUD_WEIGHT_SENSOR = 9600;

// serial port from weight controller
SoftwareSerial mySerial = SoftwareSerial(RX_PIN, TX_PIN);

void setup() {
  mySerial.begin(BAUD_WEIGHT_SENSOR);
  Serial.begin(BAUD_IDE);
}

void loop() {
  while (mySerial.available()) {
    int inChar = mySerial.read();
    if (inChar != '\n') {
      serialData += (char)inChar;
    }
    else {
      int dataSize = serialData.length();
      Serial.print(serialData);
      Serial.print(" length:  ");
      Serial.print(dataSize);
      Serial.print("\n");
      delay(3000);
      serialData = "";
    }
  }
  serialData = "";

}

// this one works perfectly but i want to store as string to
process
// information and use for other functions
/*void loop() {
if (mySerial.available()){
  Serial.print((char)mySerial.read());

I have got the same problem, if you have already had the answer please help me.
Thanks in advance

You need to disconnect the Arduino`s RX and TX pins from any device before trying to upload a sketch via USB, because the Serial data is directly wired from the USB chip to these pins. It's as if you're trying to flash the thing behind your RS232 adapter.

Yes, if they were trying to use the hardware UART, but they are not - the root problem is that they placed the peripheral and their software UART on the hardware UART pins rather than on distinct pins, creating an unnecessary conflict with operation as well as flashing.  Your suggestion will get the code uploaded, but not make it work (if they  do see output, it would be output directly from the converter, not through the sketch).

that worked, atleast i m getting some data now but it's not what i expected

You are attempting to talk to your peripheral via a second serial UART implemented in software on arbitrary pins, which should leave the hardware UART free for uploading and debug or other runtime communication between the Arduino and a PC.
However, the "arbitrary pins" you choose to use to connect the peripheral are the same pins as used by the hardware UART.
Move your peripheral to two other pins, for example
int RX_PIN = 2;
int TX_PIN = 3;

and move the connections accordingly
Also consider if you really want Serial.println() which will add a line break after every character in the output, and will also print the received characters as their numeric ASCII codes, one per line, rather than printing the characters themselves.  You probably want Serial.write().

I did as you said. However, the output is not what was desired.please see my latest comment

As I already said, serial.println() is not what you want.  However it looks like the problem is more than just line breaks.  As Serial.read() returns an integer, you are printing the ascii codes of your data rather than the data itself.  Apparently to fix that you want Serial.write()

fixed it, still have minor bugs, please check my revised post. is the current bug related to baud rate?


text:
What may have happend to this arduino NANO?
Accidentally I just short circuit my arduino nano, using a led neopixel, between the 5vOutput with one of the data pins.
Now the pc doesnt recognize the device when I connect it.
In the device (a NANOV3.0).

Only the PWR(POWER/ON) led is light up, while L light doesn't. Using the multimeter VoltsDC(20), between the ground (USB) and the pin 5v it just give me 2 Volts
What may it be? How should I chek it? It is possible to fix changing a microcomponent?
Thank you

Before tearing your hair out much about this further I would disconnect it. Shut the machine off, wait a while, turn it on, and see if the voltage is more normal (well above 2V) again.

@timemage thank you for your suggestion, I checked out again and is still in 2 volts (1.99 to be more accurate) Do you have another idea? Or at least do you know any video tutorial which show how to test with a multimeter with section may be malfunctioning?. The led in the power it isn't at the full original brighness tho, it is like, 50%.

Nothing coming to mind that I can turn into an answer. I just wanted to make sure your was not effectively self healing.

the device is double sided ... you posted a picture of only one side

Seems like there is damage. You might want to compare with a working Nano. What voltage is at the "3V3" pin? Did you look up the schematic to get ideas what could be dead?

There is stepdown chip and diode on the other side. Most time diode is blown and shorting VCC. Or maybe stepdown is blown as well. Show us picture from bottom side

Tell in more detail please how the Neopixel was connected, and for how long, and what else happened. Also measure all supply voltage pins (5V, 3.3V, Vin) against GND pin and tell us.


text:
Hardware serial baudrate inconsistent between Arduino nano and standalone 328P
I have a 328P (328P-AUR to be specific, [link]), and in the schematic below is how I've implemented it to a PCB:

Uploading a program works fine, but I hink there is an issue with the clock source, since the programs seem to run too slow, and timing-critical protocols like the hardware UART/Serial transmits at only 16th of it's intended baudrate. This is the program I'm testing the serial with:
void setup() {
  Serial.begin(9600);
}
uint8_t count = 0;
void loop() {
  Serial.print("Num:");
  Serial.println(count++);
  delay(1000);
}

So in the case of Serial.begin(9600); here, the microcontroller actually transmits at only 600 bauds, or in the case of Serial.begin(115200);, the actual transmission rate is only 7200.
I'm currently using an Arduino Uno with the "Arduino as ISP" programming mode, but this method doesn't allow me to set any of the fuses in the 328P... I do have a dedicated ICSP programmer that only works on Microchip studio, which I could try to do this with, but I'm not certain of the fuse value i'd have to set for it to work correctly with the 16MHz external crystal I have connected to the 328P.
Is there anythwing wrong with my design, or is this just a limitation when uploading with Arduino IDE? If so, what values do I configre the fuses with for this hardware?

A raw ATmega328P chip had the CKDIV8 (divide by 8) fuse programmed and to use the internal 8MHz oscillator. You should be able to use AVRDUDE together with "Arduino as ISP" to change the fuse settings. Alternatively, you could use minicore https://github.com/MCUdude/MiniCore (option no bootloader) to set the fuses and then upload code.
Your design appears to match the Arduino Uno and the fuse settings can be found in the boards.txt file:

uno.bootloader.low_fuses=0xff
uno.bootloader.high_fuses=0xde
uno.bootloader.extended_fuses=0x05

EDIT
The standard Uno fuse settings above assume that you are going to use a bootloader of 512 bytes. If, however, you are not using a bootloader and always use an ISP programmer, then the fuse BOOTRST should be unprogrammed. This frees 512 bytes flash memory for your program. It also prevents an undefined situation if your sketch is large enough to stray into the bootloader area at the high end of the flash memory. You can use this fuse calculator to determine the correct settings: https://eleccelerator.com/fusecalc/fusecalc.php?chip=atmega328p

I tried both methods and they worked. I also tried MicrochipStudio with AVRISP MK2 and I copied the fuse settings from the AVRDUDE output from your first suggestion and that also worked just fine. Thank you!


text:
How do I make my Arduino do a specific action when the computer is locked/unlocked?
I have a windows computer connected to my Arduino Uno. I work in a area with a bunch of cubicles and we leave our desk fairly regularly to go and troubleshoot other computers (I'm a service desk technician).
When we leave we are instructed to raise and lower a small flag so management can see whether or not we are sitting at our desk. I've attached my arduino to a servo motor with the following code.

#include <Servo.h>

Servo myservo;  // create servo object to control a servo
#define servoPin 3 //~
#define pushButtonPin 2

int angle =0;    // initial angle  for servo
int angleStep =20;
const int minAngle = 0;
const int maxAngle = 90;

int buttonPushed =0;

void setup() {
  // Servo button demo by Robojax.com
  Serial.begin(9600);          //  setup serial
  myservo.attach(servoPin);  // attaches the servo on pin 3 to the servo object
  pinMode(pushButtonPin,INPUT_PULLUP);
   Serial.println("Nathan's Status flag");
}

void loop() {
  if(digitalRead(pushButtonPin) == LOW){
    buttonPushed = 1;
  }
   if( buttonPushed ){
  // change the angle for next time through the loop:
  angle = angle + angleStep;

    // reverse the direction of the moving at the ends of the angle:
    if (angle <= minAngle || angle >= maxAngle) {
      angleStep = -angleStep;
       buttonPushed = 0;
    }
    myservo.write(angle); // move the servo to desired angle
      Serial.print("Moved to: ");
      Serial.print(angle);   // print the angle
      Serial.println(" degree");
  delay(100); // waits for the servo to get there
   }
}

We also have a policy that we need to keep our computers locked for obvious reasons. I learned my lesson with that early on. I would like to edit my code so that when I lock my computer the flag goes down, then when my computer is unlocked it goes back up. That way as long as I remember to keep my computer locked when I'm away I don't have to worry about the flag. Here is my breadboard/arduino layout.

I also have processing on my computer and am planning on using that. (https://processing.org/)
Any help is greatly appreciated.

The aspect of detecting whether or not the computer is currently locked from within Processing is probably better asked on the regular stackexchange.  If there's a specific question having to do with the Arduino side running the servo your question could be about that.

you could try reversing the sequence of events ... maybe pressing the button at the arduino could lock the computer

https://stackoverflow.com/questions/5881887/running-a-script-before-locking-a-computer-on-windows

Read a value through serial (what exactly is entirely up to you) to do the same job the button does now.
Use Serial.read() to get that data, and Serial.available() to know if there is any data to read.
How you generate that value on the PC to send through serial we cannot help you with, as that is outside the scope of this site.