IDE v 2.3.2, WIN11
GitHub - dougp2/Multi_Timer_V2: Arduino timer library - multiple types of timers · GitHub was published into the IDE library manager last year.
Now it doesn’t work and different error messages are given depending on which board is the target.
With this sketch;
/* Demonstrate Multi_Timer_V2 on-delay timer function
and timer done one-shot function
Operation and expected result:
- Connect an LED to pin D10 with appropriate current limiting
resistor R1.
LED R1
D10 --->|---/\/\--- GND
- Start the IDE serial monitor. Insure baud rates between
processor and monitor match.
Connect D4 to GND with either a switch or breadboard jumper.
While the timer is running and has not reached preset the
LED on D10 will light. Once preset is reached LED on D10 goes off.
and the built-in LED turns on. When
switch is off or jumper is removed built-in LED turns off.
When the timer reaches preset a counter is incremented
and the value is displayed on the IDE serial monitor.
*/
#include <Multi_Timer_V2.h>
OnDelayTimer myTimer1(1000);
int counter1 = 0;
byte timerRunning = 10;
byte switch1 = 4;
void setup() {
Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);
pinMode(timerRunning, OUTPUT);
pinMode(switch1, INPUT_PULLUP);
}
void loop() {
myTimer1.update(); // refresh the timer value and flags
// Enable/disable the timer using the ternary operator
myTimer1.setEnable(digitalRead(switch1) ? false : true);
// Turn an output on or off using the ternary operator
digitalWrite(LED_BUILTIN, myTimer1.isDone() ? HIGH : LOW);
// Turn an output on or off using if/else
if (myTimer1.isRunning()) {
digitalWrite(timerRunning, HIGH);
} else digitalWrite(timerRunning, LOW);
// Show the updated counter value
if (myTimer1.getDoneRose()) {
Serial.println(++counter1);
}
}
ATtiny85/Micronucleus error. Board = Amazon.com: 3pcs Digispark Kickstarter ATtiny85 Module General Micro USB Development Board for Arduino : Electronics :
In file included from C:\Users\User\OneDrive\Documents\Arduino\compile_test1\compile_test1.ino:25:0:
c:\Users\User\OneDrive\Documents\Arduino\libraries\Multi_Timer_V2\src/Multi_Timer_V2.h:155:9: error: conflicting return type specified for 'virtual bool OffDelayTimer::update()'
bool update();
^~~~~~
c:\Users\User\OneDrive\Documents\Arduino\libraries\Multi_Timer_V2\src/Multi_Timer_V2.h:84:19: error: overriding 'virtual boolean Multi_Timer::update()'
virtual boolean update(); // Updates the timer which calls it.
^~~~~~
UNO error:
c:\Users\User\OneDrive\Documents\Arduino\libraries\Multi_Timer_V2\src\Multi_Timer_v2.cpp:261:30: error: virt-specifiers in 'update' not allowed outside a class definition
bool OffDelayTimer::update() override{
^~~~~~~~
I discovered this while working on a project using a DigiStump ATtiny85 clone. One of the possible problems with this board is mentioned at the bottom of the FadeLed readme
Pushing the can down the road I moved development to an UNO. I now get library errors on that board also.
Possibly useful: When I put this library up it did appear in the library manager and the examples appeared in the library dropdown. It’s still visible in the library manager and the ‘include library’ dropdown but the examples don’t show.
I verified all the libarary examples on the UNO before publishing and everything worked. Now, not so much.
What I’ve tried:
Shutdown the IDE and restarted.
Shutdown the PC and restarted.
One of the possible problems with this board (Digistump) is mentioned at the bottom of the FadeLed readme –
<Error compiling for Digispark GitHub - septillion-git/FadeLed: Makes fading LEDs on an Arduino easy · GitHub >.
I added the indicated flag(?) to the platform.txt file but that didn’t help. I’ve since removed that bit from the platform.txt file.
What have I done wrong?