Looks like the controller has a simple serial interface (set speed by sending a byte). So, instead of an EE solution you could think of using a Teensy (or a cheap controller like a XIAO) to read in the throttle value, calculate the required speed...
Micros returns a 32bit result. It overflows every 2^32 µs which is every 4.295E9 µs (=4295s = 71.6min). To prolong this you can store the value in the lower 32 bits of a 64bit variable. Then look periodically (at least once every 71min) if the...
Some websites offer a 'copy button' for code blocks grabbing everything within to the clipboard. Is that an option? - rather than having to manually drag select code text start to end to copy.
Note: good for the forum - my bad - just came back...
Because the two GPT timers have dedicated interrupts (which you requested) and are 32bit as the IntervalTimer (PIT) you originally used.
Notation means: (modules x channels), modules share one interrupt. -> GPT has two modules, one channel per...
Here a biased :) and not necessarily complete list of advantages / drawbacks
+ covers PIT (1x4), GPT(2x1), TMR(4x4), RTC(1x1) and software timers, (TCK32 and TCK64 1x20) with exactly the same API
+ provides periodic and one-shot functionality...
Each of the channels generates the same interrupt. But the channels maintain ther own interrupt flags. In the ISR one checks which interrupt flag was set and invokes the corresponding callback. See here for the relevant code...
IIRC (I don't use the Arduino IDE a lot) it used to change the build location only at startup but this might have changed.
Of course your dislike of Microsoft is none of my business. I just want to mention that vsCode is open source...
A few notes:
What happens without the --delegate?
Do you actually need the IDE to upload? Once TyCommander has the hex file accociated, you can upload from there. It remembers the accociation even if you restart it. So compile with the IDE and...
At least I'm not aware of any issues. Have a close look at the other libraries (if any) you are using. Or better, just try...
Edit: just saw in #1 that you have troubles. Can you describe what doesn't work? Some code?
Yes, if you need PWM (analogWrite), you need to make sure not to use one of the timers which generate the PWM signal for this pin. Here some information and a list of which timer generates the PWM for which pin...
Here how your example would look like using the TimerTool:
#include "TeensyTimerTool.h"
using namespace TeensyTimerTool;
volatile bool pauseInterruptPrints = false;
PeriodicTimer timer1(GPT1);
PeriodicTimer timer2(GPT2);
void spam(){
if...
Have a look at the TeensyTimerTool. It has a WIKI with a lot of usage examples (https://github.com/luni64/TeensyTimerTool/wiki)
Please use v1.3.0. Later versions require the Teensyduino beta version (1.59beta)
On a T4.x all four interval timers generate the same interrupt and thus have the same priority. Setting priority for one sets it for all. So you can't interrupt a intervalTimer ISR by another one. You could use the GPT timers instead if you need...
This seems to be meant for inline code. Like when you say: "Don't forget to put while(!Serial){} into setup()" The other one is meant for dedicated code blocks. I like the extra input box since it has a monospaced font which makes code editing...
Yes, you can switch the GPT to 150MHz. Here the relevant code from the TeensyTimerTool
if (USE_GPT_PIT_150MHz) // timer clock setting from config.h
CCM_CSCMR1 &= ~CCM_CSCMR1_PERCLK_CLK_SEL; // use F_BUS as...