Know-How
Completed
Digital input not reading: NPN or PNP, step by step
248 Views •4-20 mA input reading wrong: check it step by step
238 Views •RS-485: how to check a bus step by step
234 Views •Scaling a 4-20 mA signal in the PLC: formula, constants and code
229 Views •Relay or transistor output: which one and how to check it
189 Views •Modbus RTU timeout: 6 checks before blaming the wiring
142 Views •Upload fails: 6 checks before blaming the code
138 Views •4G PLC not connecting: 6 checks before blaming the code
105 Views •LoRa works on the desk, fails in the field: 6 checks before you install
94 Views •Choosing a PLC 1: count the I/O and leave spare
32 Views •Choosing a PLC 2: which communications do you really need
31 Views •SD card corrupted? 6 habits for Linux in the field
30 Views •LoRaWAN node won't join: 6 checks, in order
29 Views •Arduino IDE compile error: 6 checks before the code
28 Views •Touch panel: screen turned, touch didn't. 6 checks
29 Views •Arduino IDE compile error: 6 checks before the code
Short answer: when Verify fails in the Arduino IDE, read the first error, check the include and the library folder, the selected board, the board package and the versions, in this order, before you change the code.
Download the checklist (PDF, 2 pages)
Descarga la lista de comprobación (PDF, 2 páginas)
These checks apply to Arduino IDE 1.x and 2.x and to arduino-cli, with any board. They cover compiling only: if the sketch compiles but does not reach the board, start with the lesson on upload failures.
Six checks, in this order
| Check | What to do | Good result |
|---|---|---|
| 1. First error | Scroll up the console to the first line with "error:" and fix that one first. The errors below it often come from it. To see more detail, turn on "Show verbose output during" compile in Preferences. | After compiling again, the other errors go away or change. |
| 2. Include | "No such file or directory" usually means that the library is not installed. Install it with the Library Manager (Tools > Manage Libraries) or with Sketch > Include Library > Add .ZIP Library. Check also the spelling of the include: on Linux, upper and lower case count. | The compiler finds the header. |
| 3. Folder | Keep one copy of each library, in the libraries folder of your sketchbook. If the log says "Multiple libraries were found", read the Used: line, which is the copy that was compiled. That message alone does not stop the compile. | Used: points to the copy you want. |
| 4. Board | Select the board in Tools > Board. The board sets the architecture, and a library written for another architecture can fail. The log warns with "claims to run on ... architecture(s)". | No architecture warning, or a library that supports your board. |
| 5. Board package | Each board needs its core, installed from the Boards Manager (Tools > Board > Boards Manager). Third-party boards are listed only after you add their URL in Preferences, "Additional boards manager URLs", one URL per line. | The board appears in Tools > Board. |
| 6. Versions | Core and library have to work together. If it stopped compiling after an update, install the previous version from the Library Manager or the Boards Manager. From IDE 1.x to 2.x: IDE 2 may not take your old settings, so check the sketchbook location and the additional URLs. | The same sketch compiles again. |
What the console tells you
- "fatal error: X.h: No such file or directory": library not installed or include misspelled.
- "Multiple libraries were found for": two copies of the library; check the Used: line.
- "WARNING: library ... claims to run on ... architecture(s)": the selected board has another architecture.
- "Platform ... not found: platform not installed": the board package is not installed.
- Errors inside library files after an update: core and library versions that do not work together.
- Compiled in IDE 1.x, IDE 2 finds nothing: sketchbook location or additional URLs not carried over.
Industrial Shields PLCs
Arduino based PLCs (M-Duino, Ardbox) and ESP32 PLCs compile with the Industrial Shields boards. Add http://apps.industrialshields.com/main/arduino/boards/package_industrialshields_index.json in "Additional boards manager URLs", then search "industrialshields" in the Boards Manager and install the package for your PLC: "industrialshields", "industrialshields-esp32" or "industrialshields-megaavr". Then select the family and the model in the Tools menu. Raspberry PLC is not programmed with the Arduino IDE.
Next steps
- Upload fails? 6 checks before blaming the code
- How to install Industrial Shields boards in the Arduino IDE
- Free course: Arduino PLC Programming: Foundations
Sources
Arduino Help Center: If your sketch doesn't compile, Add libraries to Arduino IDE, Error: Multiple libraries were found, Find sketches, libraries, cores and other files, Add or remove third-party boards in Boards Manager. docs.arduino.cc: Arduino IDE 2 Board Manager and library tutorials, Arduino Library specification, arduino-cli sketch build process and configuration. Message texts from the arduino-cli source.
Commenting is not enabled on this course.