New Fun Arduino Library Error

My R32 just isn’t going to make any tones, so I ported the code over to the Uno.

I hit the upload button and learned there’s a new problem with the Arduino library.
This is what I get, and it ends there. When I hit the upload button again, it says a task is running. Do you want to restart task?

Processing uno (platform: atmelavr; board: uno; framework: arduino)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: Redirecting...
PLATFORM: Atmel AVR 2.2.0 > Arduino Uno
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 31.50KB Flash
DEBUG: Current (simavr) On-board (simavr)
PACKAGES:

  • framework-arduino-avr 5.0.0
  • tool-avrdude 1.60300.200527 (6.3.0)
  • toolchain-atmelavr 1.50400.190710 (5.4.0)
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Looking for Arduino library in registry
    Conflict: More than one library has been found by request {“name”: “Arduino”, “requirements”: null}:
    arduino
    Automatically chose the first available library (use --interactive option to make a choice)=====
    ==
    #ID: 2171
    arduino library for mbed

Compatible frameworks: Mbed
Compatible platforms: Atmel SAM, Freescale Kinetis, Nordic nRF51, NXP LPC, Silicon Labs EFM32, ST STM32, Teensy, Nordic nRF52, Maxim
32, WIZNet W7500, RISC-V GAP, NXP i.MX RT
Authors: SE HUI PARK

Arduino

#ID: 3194
Arduino functions millis, micros and eventually some more to come

Keywords: arduino, micros, millis
Compatible frameworks: Mbed
Compatible platforms: Atmel SAM, Freescale Kinetis, Nordic nRF51, NXP LPC, Silicon Labs EFM32, ST STM32, Teensy, Nordic nRF52, Maxim
32, WIZNet W7500, RISC-V GAP, NXP i.MX RT
Authors: Eduardo de Mier

Arduino

#ID: 2172
Library to allow the use of Arduino specific language with the mbed

Keywords: arduino, mbeduino
Compatible frameworks: Mbed
Compatible platforms: Atmel SAM, Freescale Kinetis, Nordic nRF51, NXP LPC, Silicon Labs EFM32, ST STM32, Teensy, Nordic nRF52, Maxim
32, WIZNet W7500, RISC-V GAP, NXP i.MX RT
Authors: Chris Dick

arduino

#ID: 8534
arduino

Compatible frameworks: Mbed
Compatible platforms: Atmel SAM, Freescale Kinetis, Nordic nRF51, NXP LPC, Silicon Labs EFM32, ST STM32, Teensy, Nordic nRF52, Maxim
32, WIZNet W7500, RISC-V GAP, NXP i.MX RT
Authors: feng jiantao

Arduino

#ID: 9015
Library to allow the use of Arduino specific language with the mbed

Keywords: arduino, mbeduino
Compatible frameworks: Mbed
Compatible platforms: Atmel SAM, Freescale Kinetis, Nordic nRF51, NXP LPC, Silicon Labs EFM32, ST STM32, Teensy, Nordic nRF52, Maxim 3
32, WIZNet W7500, RISC-V GAP, NXP i.MX RT
Authors: Sai Rahul Sitaram

Arduino

#ID: 9414
arduino

Compatible frameworks: Mbed
Compatible platforms: Atmel SAM, Freescale Kinetis, Nordic nRF51, NXP LPC, Silicon Labs EFM32, ST STM32, Teensy, Nordic nRF52, Maxim 3
32, WIZNet W7500, RISC-V GAP, NXP i.MX RT
Authors: team2

Found: PlatformIO Registry

Look at all the lines with “compatible frameworks”, they all say “mbed”, that’s not for the uno.

You do not need the arduino library for an arduino. All the functions in the library are built in, just like the Arduino IDE.

All you have to do in PlatformIO, to successfully compile an Arduino sketch, is to add `#include “Arduino.h” to the top of your code.

You might need to add a library, in the same way you do in the Arduino IDE, when you need Servo, or LiquidCrystal etc.

Take Arduino out of your lib_deps.

Are you still thinking, possibly misled by the Arduino IDE, that Sketch->Add library, does nothing more than add #include "library_name.h" to your code?

Do you think that a library is just a header file (*.h)? It isn’t.

The header file tells the compiler which functions exist in the library, what parameters they take, what result they return, etc. This is needed in a normal C/C++ program before the functions are used.

In the Arduino sketches, compiling a sketch does lots of “weird” things, one of which is to test compile your code, quietly and without you knowing, trapping the errors, and attempting to find the missing header filrs. Those that are missing, and Arduino.h is one of them, are added at the top of your sketch – without telling you.

That is why writing for Arduino is easier, but confusing when you move away from it, and start to do proper coding.

A header file, *.h, can be all you need for a library, but not always. Usually, the header tells you/the compiler, what is in the library.

HTH

Cheers,
Norm.

Oh! RIght! Arduino.

I’m only working with the -32 these days, but that won’t use a library I need. So I do have to use this HC-06 Bluetooth module. I hope it does BLE.