Problem when trying to include the ArduinoThread library.

Hi, everyone. I am trying to use this library. As installation instruction suggests

Paste the modified folder on your Library folder (On your Libraries folder inside Sketchbooks or Arduino software).

So initially I pasted the ArduinoThread into Arduino software which I think in my case is /opt/arduino-1.8.5/. Then I added it through Arduino IDE: Sketch->AddLibrary. or something, after that the ArduinoThread appeared in the sketchbook/libraries folder.
But it did not work.
In my program I write:

#include <Thread.h>
#include <ThreadController.h>

then

make

but I get the error (few last lines):

mkdir -p build-uno
/opt/arduino-1.8.5/hardware/tools/avr/bin/avr-g++ -x c++ -include Arduino.h -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=185 -DARDUINO_ARCH_AVR -D__PROG_TYPES_COMPAT__ -I/opt/arduino-1.8.5/hardware/arduino/avr/cores/arduino -I/opt/arduino-1.8.5/hardware/arduino/avr/variants/standard -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto -fno-devirtualize -fdiagnostics-color Threading.ino -o build-uno/Threading.ino.o
Threading.ino:1:20: fatal error: Thread.h: No such file or directory
#include <Thread.h>

#include <Thread.h>

where did you install the library?

fatal error: Thread.h: No such file or directory

Those are some terrible installation instructions. Follow these and your problem will be solved:

FYI, the advise they give about "Arduino software" is very bad. You should never install a library to the Arduino IDE installation folder because it will be lost when you update to a new IDE version. Always install to the sketchbook folder.

I placed ArduinoThread in my sketchbook folder:
[ICU]:sketchbook> tree -d
.
├── Arduino_mk
│ ├── bin
│ ├── examples
│ │ ├── AnalogInOutSerial
│ │ ├── ATtinyBlink
│ │ ├── Blink
│ │ ├── BlinkChipKIT
│ │ ├── BlinkInAVRC
│ │ ├── BlinkNetworkRPi
│ │ ├── BlinkOpenCM
│ │ ├── BlinkTeensy
│ │ ├── BlinkWithoutDelay
│ │ ├── Fade
│ │ ├── HelloWorld
│ │ ├── MakefileExample
│ │ ├── master_reader
│ │ ├── SerialPrint
│ │ ├── TinySoftWareSerial
│ │ ├── toneMelody
│ │ └── WebServer
│ ├── packaging
│ │ ├── debian
│ │ └── fedora
│ └── tests
│ └── script
│ └── bootstrap
├── Blink
│ └── build-uno
│ └── core
├── HC-SRO4
│ └── build-uno
│ └── core
├── L_Blink_2sec
├── LED
│ └── build-uno
│ └── core
├── libraries
│ └── ArduinoThread
│ ├── examples
│ │ ├── ControllerInController
│ │ ├── ControllerWithTimer
│ │ ├── CustomTimedThread
│ │ ├── SensorThread
│ │ ├── SimpleThread
│ │ ├── SimpleThreadController
│ │ └── StaticThreadController
│ └── extras
├── Serial
│ └── build-uno
│ └── core
├── TestCPP
│ └── build-uno
│ └── core
├── Threading
│ └── build-uno
└── TMP
└── build-uno
└── core

58 directories

I solved my problem. The point was to include ArduinoThread library in the Makefile that I used:

ARDUINO_LIBS += ArduinoThread

Hi,
For Windows;

All downloaded directories are best placed in

Documents >> Arduino >> libraries

This is specifically so no matter what IDE version you use or update, your libraries will be in the one place that ALL of the IDEs are setup for.
You do not need to extract the zip files, leave them in there and the libraries manager will extract them and any examples for you.

Tom... :slight_smile: