The IRQ_FTM2 handler is further down in the Tekceleo class:
void Tekceleo::ftm2_isr(void)
{
if((FTM2_SC & FTM_SC_TOF) != 0){
FTM2_SC &= ~FTM_SC_TOF;
}
digitalWrite(pin_PPen, LOW);
motorTurning = true;
Well, I'm back again. The code compiles fine and actually does move the motor, but still not the way I want it to. I did not get to the part where the IntervalTimer comes into play, so no idea if that works how it...
The main problem was just the compiling, it did not compile so absolutely no chance for any hardware issues ;-) Compiler moaned about non-static function used in the two IntervalTimers.
With the added code by luni...
Oh, I see I was not too exakt.
That part (and the whole rest) was working and I think should be working.
What doesn't work is:
void Tekceleo::start(float flowrate)
{
set_timebase(flowrate);
noInterrupts();...
Hello,
I have a problem with using IntervalTimer in a class. I know this problem is entirely based on my missing experince with C++, and I hope you can help me fix it.
I use a teensy3.6 to drive a piezo motor....
I got it working, by adjusting the FTM_PWMLOAD register. Not very intuitive to look there.
The code snippet in the ISR where the MOD is changed is:
void ftm2_isr(void) {
if((FTM2_SC & FTM_SC_TOF) != 0){...
Hello,
I got the encoder working, works nice. It is used to control a piezo motor. The motor is pulsed, so the pin for turning the motor on is set HIGH at the beginning of a cycle and the encoder throws an interrupt...