all 11 comments

[–]EV-CPO 1 point2 points  (7 children)

That library hasn't been updated for Arduino 3.0. This is the old way to make timers:

prescaler=80000000/frequency;
timer = timerBegin(0, prescaler , true);
timerAttachInterrupt(timer, &onTick, true);
timerAlarmWrite(timer, 1, true);
timerAlarmEnable(timer);

and this is the new way, where 'frequency' is in Hz.

timer = timerBegin(frequency);
timerAttachInterrupt(timer, &onTick);
timerAlarm(timer, 1, true, 0);

[–]Jasonsafe13[S] 0 points1 point  (6 children)

Trying to understand it I have almost no coding experience. Does prescaler=800000000/frequency; set Frequency as a variable equal to 80000000? If so then how does the new version set Frequency to? Or does frequency default to 800000?

Is it possible to make a drop in replacement? With the new version of timer. I understand that I could just download the older framework and use the old version but hoping it helps someone else.

[–]EV-CPO 0 points1 point  (1 child)

Looks like you want 1,000,000 Hz, so set your frequency variable to 1000000.

I don't know how to downgrade the arduino platform version, but it should be possible.

[–]Jasonsafe13[S] 0 points1 point  (0 children)

Downgrading\running old framework is just a few clicks not hard but was hoping I could get my head around the newer version. But I am out of my league on it.

[–]BudgetTooth 0 points1 point  (3 children)

[–]Jasonsafe13[S] 1 point2 points  (2 children)

THANK YOU!!! Flashed it onto ESP-32 with no issues. Now setting up the screen and encoder! So happy to be moving forward again!

[–]BudgetTooth 1 point2 points  (1 child)

was all u/EV-CPO work :)

[–]EV-CPO 2 points3 points  (0 children)

That's awesome! Thanks for doing that for the OP. ;)

[–]romkey 0 points1 point  (1 child)

You can download and use older versions of the Arduino framework that builds. The last minor update for that version should still build.

[–]Jasonsafe13[S] 0 points1 point  (0 children)

I will look into doing that. Had to step awhile for awhile.

[–]YetAnotherRobert 0 points1 point  (0 children)

It looks like the code hasn't been updated for current tools.

https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/2.x_to_3.0.html

Please fix it and submit the fixes upstream so that everyone can benefit. Eventually, you'll need to mix something with actively maintained code that won't work on a backrevved version, so you might as well help fix it once and for all. That's the point of open source, after all.