Hello,
Help needed to decode where is the compilation problem with this code. My board is ESP32 development board, 38 pins. I tried to select many esp32 board, but all failed. IoAbstraction.h and TaskManagerIO Libraries are installed using the Auduino library tools.
Martin
/*
Timed blink, this example shows how to build the simple Blink application using both IoAbstraction
and TaskManager. This gives an example of how quickly a simple application can be made to leverage
this library.
Because this example uses IoAbstraction, the LED could be on the end of an i2c expander or even
on a shift register. Further, if you then needed a second timed action, it would be trivial to
add.
Documentation and reference:
https://www.thecoderscorner.com/products/arduino-downloads/io-abstraction/
https://www.thecoderscorner.com/ref-docs/ioabstraction/html/index.html
*/
#include <Wire.h>
#include<IoAbstraction.h>
#include<TaskManagerIO.h>
// constant for the pin we will use
const int ledPin = 13;
// the state of the pin, we will toggle it.
int ledOn = LOW;
// create an IO abstraction, so later we could put the led on a shift register or i2c.
void setup() {
Serial.begin(115200);
Serial.println("1");
// set the pin we are to use as output using the io abstraction
internalDigitalDevice().pinMode(ledPin, OUTPUT);
// and create the task that toggles the led every second.
taskManager.scheduleFixedRate(1000, toggle);
Serial.println("3");
}
// this is the call back method that gets called once a second
// from the schedule above.
void toggle() {
Serial.println("4");
// now we write to the device, the 'S' version of the method automatically syncs.
internalDigitalDevice().digitalWriteS(ledPin, ledOn);
ledOn = !ledOn; // toggle the LED state.
}
void loop() {
// this is all we should do in loop when using task manager.
taskManager.runLoop();
}
compilation error script.
c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src\SwitchInput.cpp: In member function 'virtual void EncoderUpDownButtons::onPressed(pinid_t, bool)':
c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src\SwitchInput.cpp:524:23: warning: comparison is always true due to limited range of data type [-Wtype-limits]
524 | } else if(backPin != -1 && passThroughListener && pin == getBackPin()) {
| ~~~~~~~~^~~~~
c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src\SwitchInput.cpp:526:23: warning: comparison is always true due to limited range of data type [-Wtype-limits]
526 | } else if(nextPin != -1 && passThroughListener && pin == getNextPin()) {
| ~~~~~~~~^~~~~
c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src\SwitchInput.cpp: In member function 'virtual void EncoderUpDownButtons::onReleased(pinid_t, bool)':
c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src\SwitchInput.cpp:532:16: warning: comparison is always true due to limited range of data type [-Wtype-limits]
532 | if(backPin != -1 && passThroughListener && pin == getBackPin()) {
| ~~~~~~~~^~~~~
c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src\SwitchInput.cpp:534:23: warning: comparison is always true due to limited range of data type [-Wtype-limits]
534 | } else if(nextPin != -1 && passThroughListener && pin == getNextPin()) {
| ~~~~~~~~^~~~~
c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src\esp32\ESP32AnalogDevice.cpp: In member function 'uint16_t EspAnalogInputMode::getCurrentReading()':
c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src\esp32\ESP32AnalogDevice.cpp:69:15: error: 'DAC1' was not declared in this scope
69 | if(pin == DAC1 || pin == DAC2) {
| ^~~~
c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src\esp32\ESP32AnalogDevice.cpp:69:30: error: 'DAC2' was not declared in this scope
69 | if(pin == DAC1 || pin == DAC2) {
| ^~~~
In file included from c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src/esp32/ESP32AnalogDevice.h:9,
from c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src/AnalogDeviceAbstraction.h:89,
from c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src\esp32\ESP32AnalogDevice.cpp:6:
c:\Users\Utilisateur\Documents\Arduino\libraries\SimpleCollections\src/SimpleCollections.h: In instantiation of 'static void tccollection::BtreeList<K, V>::copyInternal(void*, const void*) [with K = unsigned char; V = EspAnalogOutputMode]':
c:\Users\Utilisateur\Documents\Arduino\libraries\SimpleCollections\src/SimpleCollections.h:144:84: required from 'tccollection::BtreeList<K, V>::BtreeList(bsize_t, tccollection::GrowByMode) [with K = unsigned char; V = EspAnalogOutputMode; bsize_t = unsigned int]'
c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src\esp32\ESP32AnalogDevice.cpp:119:38: required from here
c:\Users\Utilisateur\Documents\Arduino\libraries\SimpleCollections\src/SimpleCollections.h:174:23: warning: implicitly-declared 'EspAnalogOutputMode& EspAnalogOutputMode::operator=(const EspAnalogOutputMode&)' is deprecated [-Wdeprecated-copy]
174 | *itemDest = *itemSrc;
| ~~~~~~~~~~^~~~~~~~~~
c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src\esp32\ESP32AnalogDevice.cpp:90:1: note: because 'EspAnalogOutputMode' has user-provided 'EspAnalogOutputMode::EspAnalogOutputMode(const EspAnalogOutputMode&)'
90 | EspAnalogOutputMode::EspAnalogOutputMode(const EspAnalogOutputMode& other) {
| ^~~~~~~~~~~~~~~~~~~
c:\Users\Utilisateur\Documents\Arduino\libraries\SimpleCollections\src/SimpleCollections.h: In instantiation of 'static void tccollection::BtreeList<K, V>::copyInternal(void*, const void*) [with K = unsigned char; V = EspAnalogInputMode]':
c:\Users\Utilisateur\Documents\Arduino\libraries\SimpleCollections\src/SimpleCollections.h:144:84: required from 'tccollection::BtreeList<K, V>::BtreeList(bsize_t, tccollection::GrowByMode) [with K = unsigned char; V = EspAnalogInputMode; bsize_t = unsigned int]'
c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src\esp32\ESP32AnalogDevice.cpp:119:38: required from here
c:\Users\Utilisateur\Documents\Arduino\libraries\SimpleCollections\src/SimpleCollections.h:174:23: warning: implicitly-declared 'EspAnalogInputMode& EspAnalogInputMode::operator=(const EspAnalogInputMode&)' is deprecated [-Wdeprecated-copy]
174 | *itemDest = *itemSrc;
| ~~~~~~~~~~^~~~~~~~~~
c:\Users\Utilisateur\Documents\Arduino\libraries\IoAbstraction\src\esp32\ESP32AnalogDevice.cpp:24:1: note: because 'EspAnalogInputMode' has user-provided 'EspAnalogInputMode::EspAnalogInputMode(const EspAnalogInputMode&)'
24 | EspAnalogInputMode::EspAnalogInputMode(const EspAnalogInputMode& other) = default;
| ^~~~~~~~~~~~~~~~~~
exit status 1
Compilation error: exit status 1