* Executing task in folder Blink4: C:\Users\malco\.platformio\penv\Scripts\platformio.exe run –target upload
Processing uno (platform: atmelavr; board: uno; framework: arduino)
—————————————————————————————————————————————————————————————————————-
Verbose mode can be enabled via `-v, –verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR (4.2.0) > Arduino Uno
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 31.50KB Flash
DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES:
– framework-arduino-avr @ 5.1.0
– tool-avrdude @ 1.60300.200527 (6.3.0)
– toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 5 compatible libraries
Scanning dependencies…
No dependencies
Building in release mode
Compiling .pio\build\uno\src\main.cpp.o
Archiving .pio\build\uno\libFrameworkArduinoVariant.a
Compiling .pio\build\uno\FrameworkArduino\CDC.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial0.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial1.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial2.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial3.cpp.o
Compiling .pio\build\uno\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\uno\FrameworkArduino\PluggableUSB.cpp.o
Compiling .pio\build\uno\FrameworkArduino\Print.cpp.o
Compiling .pio\build\uno\FrameworkArduino\Stream.cpp.o
src\main.cpp:18:2: error: stray ‘#’ in program
}#include <Arduino.h>
^
src\main.cpp: In function ‘void setup()’:
src\main.cpp:8:7: warning: unused variable ‘result’ [-Wunused-variable]
int result = myFunction(2, 3);
^~~~~~
src\main.cpp: At global scope:
src\main.cpp:18:3: error: ‘include’ does not name a type
}#include <Arduino.h>
^~~~~~~
src\main.cpp: In function ‘void setup()’:
src\main.cpp:21:6: error: redefinition of ‘void setup()’
void setup() {
^~~~~
src\main.cpp:6:6: note: ‘void setup()’ previously defined here
void setup() {
^~~~~
src\main.cpp:25:10: error: ‘ledPin’ was not declared in this scope
pinMode(ledPin, OUTPUT);
^~~~~~
src\main.cpp:25:10: note: suggested alternative: ‘ldiv’
pinMode(ledPin, OUTPUT);
^~~~~~
ldiv
src\main.cpp: In function ‘void loop()’:
src\main.cpp:27:6: error: redefinition of ‘void loop()’
void loop() {
^~~~
src\main.cpp:11:6: note: ‘void loop()’ previously defined here
void loop() {
^~~~
src\main.cpp:30:20: error: ‘ledPin’ was not declared in this scope
digitalWrite(ledPin, HIGH);
^~~~~~
src\main.cpp:30:20: note: suggested alternative: ‘ldiv’
digitalWrite(ledPin, HIGH);
^~~~~~
ldiv
Compiling .pio\build\uno\FrameworkArduino\Tone.cpp.o
*** [.pio\build\uno\src\main.cpp.o] Error 1
========================================================================================== [FAILED] Took 0.87 seconds ==========================================================================================
* The terminal process “C:\Users\malco\.platformio\penv\Scripts\platformio.exe ‘run’, ‘–target’, ‘upload'” terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
* Executing task in folder Blink4: C:\Users\malco\.platformio\penv\Scripts\platformio.exe run –target upload
Processing uno (platform: atmelavr; board: uno; framework: arduino)
—————————————————————————————————————————————————————————————————————-
Verbose mode can be enabled via `-v, –verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR (4.2.0) > Arduino Uno
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 31.50KB Flash
DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES:
– framework-arduino-avr @ 5.1.0
– tool-avrdude @ 1.60300.200527 (6.3.0)
– toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 5 compatible libraries
Scanning dependencies…
No dependencies
Building in release mode
Compiling .pio\build\uno\src\main.cpp.o
Compiling .pio\build\uno\FrameworkArduino\USBCore.cpp.o
Compiling .pio\build\uno\FrameworkArduino\WInterrupts.c.o
Compiling .pio\build\uno\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\uno\FrameworkArduino\WString.cpp.o
Compiling .pio\build\uno\FrameworkArduino\abi.cpp.o
Compiling .pio\build\uno\FrameworkArduino\hooks.c.o
Compiling .pio\build\uno\FrameworkArduino\main.cpp.o
Compiling .pio\build\uno\FrameworkArduino\new.cpp.o
Compiling .pio\build\uno\FrameworkArduino\wiring.c.o
Compiling .pio\build\uno\FrameworkArduino\wiring_analog.c.o
Compiling .pio\build\uno\FrameworkArduino\wiring_digital.c.o
Compiling .pio\build\uno\FrameworkArduino\wiring_pulse.S.o
Compiling .pio\build\uno\FrameworkArduino\wiring_pulse.c.o
Compiling .pio\build\uno\FrameworkArduino\wiring_shift.c.o
Archiving .pio\build\uno\libFrameworkArduino.a
Linking .pio\build\uno\firmware.elf
Checking size .pio\build\uno\firmware.elf
Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
RAM: [= ] 10.2% (used 208 bytes from 2048 bytes)
Flash: [= ] 6.3% (used 2046 bytes from 32256 bytes)
Building .pio\build\uno\firmware.hex
Configuring upload protocol…
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port…
Auto-detected: COM4
Uploading .pio\build\uno\firmware.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file “.pio\build\uno\firmware.hex”
avrdude: writing flash (2046 bytes):
Writing | ################################################## | 100% 0.33s
avrdude: 2046 bytes of flash written
avrdude: verifying flash memory against .pio\build\uno\firmware.hex:
avrdude: load data flash data from input file .pio\build\uno\firmware.hex:
avrdude: input file .pio\build\uno\firmware.hex contains 2046 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.26s
avrdude: verifying …
avrdude: 2046 bytes of flash verified
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
avrdude done. Thank you.
========================================================================================= [SUCCESS] Took 3.31 seconds =========================================================================================
* Terminal will be reused by tasks, press any key to close it.
* Executing task in folder Blink4: C:\Users\malco\.platformio\penv\Scripts\platformio.exe run –target upload
Processing uno (platform: atmelavr; board: uno; framework: arduino)
—————————————————————————————————————————————————————————————————————-
Verbose mode can be enabled via `-v, –verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR (4.2.0) > Arduino Uno
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 31.50KB Flash
DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES:
– framework-arduino-avr @ 5.1.0
– tool-avrdude @ 1.60300.200527 (6.3.0)
– toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 5 compatible libraries
Scanning dependencies…
No dependencies
Building in release mode
Compiling .pio\build\uno\src\main.cpp.o
Linking .pio\build\uno\firmware.elf
Checking size .pio\build\uno\firmware.elf
Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
RAM: [= ] 10.2% (used 208 bytes from 2048 bytes)
Flash: [= ] 6.3% (used 2046 bytes from 32256 bytes)
Building .pio\build\uno\firmware.hex
Configuring upload protocol…
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port…
Auto-detected: COM4
Uploading .pio\build\uno\firmware.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% -0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file “.pio\build\uno\firmware.hex”
avrdude: writing flash (2046 bytes):
Writing | ################################################## | 100% 0.33s
avrdude: 2046 bytes of flash written
avrdude: verifying flash memory against .pio\build\uno\firmware.hex:
avrdude: load data flash data from input file .pio\build\uno\firmware.hex:
avrdude: input file .pio\build\uno\firmware.hex contains 2046 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.26s
avrdude: verifying …
avrdude: 2046 bytes of flash verified
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
avrdude done. Thank you.
========================================================================================= [SUCCESS] Took 3.00 seconds =========================================================================================
* Terminal will be reused by tasks, press any key to close it.
* Executing task in folder Blink4: C:\Users\malco\.platformio\penv\Scripts\platformio.exe run –target upload
Processing uno (platform: atmelavr; board: uno; framework: arduino)
—————————————————————————————————————————————————————————————————————-
Verbose mode can be enabled via `-v, –verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR (4.2.0) > Arduino Uno
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 31.50KB Flash
DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES:
– framework-arduino-avr @ 5.1.0
– tool-avrdude @ 1.60300.200527 (6.3.0)
– toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 5 compatible libraries
Scanning dependencies…
No dependencies
Building in release mode
Compiling .pio\build\uno\src\main.cpp.o
Archiving .pio\build\uno\libFrameworkArduinoVariant.a
Compiling .pio\build\uno\FrameworkArduino\CDC.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial0.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial1.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial2.cpp.o
Compiling .pio\build\uno\FrameworkArduino\HardwareSerial3.cpp.o
Compiling .pio\build\uno\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\uno\FrameworkArduino\PluggableUSB.cpp.o
Compiling .pio\build\uno\FrameworkArduino\Print.cpp.o
Compiling .pio\build\uno\FrameworkArduino\Stream.cpp.o
Compiling .pio\build\uno\FrameworkArduino\Tone.cpp.o
Compiling .pio\build\uno\FrameworkArduino\USBCore.cpp.o
Compiling .pio\build\uno\FrameworkArduino\WInterrupts.c.o
Compiling .pio\build\uno\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\uno\FrameworkArduino\WString.cpp.o
Compiling .pio\build\uno\FrameworkArduino\abi.cpp.o
Compiling .pio\build\uno\FrameworkArduino\hooks.c.o
Compiling .pio\build\uno\FrameworkArduino\main.cpp.o
Compiling .pio\build\uno\FrameworkArduino\new.cpp.o
Compiling .pio\build\uno\FrameworkArduino\wiring.c.o
Compiling .pio\build\uno\FrameworkArduino\wiring_analog.c.o
Compiling .pio\build\uno\FrameworkArduino\wiring_digital.c.o
Compiling .pio\build\uno\FrameworkArduino\wiring_pulse.S.o
Compiling .pio\build\uno\FrameworkArduino\wiring_pulse.c.o
Compiling .pio\build\uno\FrameworkArduino\wiring_shift.c.o
Archiving .pio\build\uno\libFrameworkArduino.a
Linking .pio\build\uno\firmware.elf
Checking size .pio\build\uno\firmware.elf
Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
RAM: [= ] 10.2% (used 208 bytes from 2048 bytes)
Flash: [= ] 6.3% (used 2046 bytes from 32256 bytes)
Building .pio\build\uno\firmware.hex
Configuring upload protocol…
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port…
Auto-detected: COM5
Uploading .pio\build\uno\firmware.hex
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xa4
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xa4
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x65
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x74
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x73
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x4a
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x75
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x6c
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x20
avrdude done. Thank you.
*** [upload] Error 1
========================================================================================= [FAILED] Took 33.54 seconds =========================================================================================
* The terminal process “C:\Users\malco\.platformio\penv\Scripts\platformio.exe ‘run’, ‘–target’, ‘upload'” terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
I sent the full code as I have tried two differnt esp boards with the same effect.
I used the same code with an Arduino Uno and it worked
Hi update the same code links to the esp32 board via the Arduino plaforrm and it works well