Arduino

From Torben's Wiki
Revision as of 06:52, 1 October 2021 by Torben (talk | contribs) (→‎Platform IO)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Arduino IDE

Adding ESP32 to Arduino IDE

see [1]

Reduce Logging

To hide the

DEBUG StatusLogger 

messages in the log, in file

c:\Program Files (x86)\Arduino\arduino_debug.l4j.ini

add

-DDEBUG=false

Coding

see C++ for Arduino coding

Alternative Software

Visual Studio Code

Installation

You really should use this one!
See How to Use Visual Studio Code for Arduino for a good install guide.

My current settings can be found in my GitHub reposititory.
Here (maybe old) copies:

arduino.json

{
   "board": "esp32:esp32:esp32",
   "configuration": "PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=115200,DebugLevel=none",
   "port": "COM4",
   "programmer": "AVR ISP",
   "sketch": "0_arduino_code/0_arduino_code.ino",
   "output": "e:/tmp/arduino-build"
}

c_cpp_properties.json

{
   "configurations": [
       {
           "name": "Arduino",
           "includePath": [
               "C:/Users/t/AppData/Local/Arduino15/packages/esp32/tools/**",
               "C:/Users/t/AppData/Local/Arduino15/packages/esp32/hardware/esp32/1.0.4/**",
               "D:/files/Hacken/GitHub/entorb/arduino-sensorics/libraries/**"
           ],
           "forcedInclude": [
               "C:/Program Files (x86)/Arduino/hardware/arduino/avr/cores/arduino/Arduino.h"
           ],
           "defines": [
               "USBCON"
           ],
           "compilerPath": "c:/Program Files (x86)/Arduino/hardware/tools/avr/bin/avr-gcc.exe",
           "cStandard": "c11",
           "cppStandard": "c++14"
           // "intelliSenseMode": "msvc-x64",
       }
   ],
   "version": 4
}

settings.json

{
   "arduino.path": "C:/Program Files (x86)/Arduino",
   "arduino.defaultBaudRate": 115200,
   "arduino.logLevel": "info",
   "arduino.additionalUrls": [
       "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json",
       "http://arduino.esp8266.com/stable/package_esp8266com_index.json"
   ],
   "C_Cpp.intelliSenseEngine": "Default",
   "C_Cpp.default.defines": [],
}

Note "arduino.logLevel": "info" to reduce the logging output

Platform IO

Alternativly Platform IO VSCode Plugin can be used, but I decided to stick to stay compatible to Arduino IDE, see Platform IO Plugin

Debugging

Not tried so far: Creating and Debugging Arduino Programs in Visual Studio Code

HyperTerminal

HTerm is better than the one included in Arduino IDE