Thanks for feedback from a happy customer.
That's not difficult. This is excellent code and a just-right solution.
If you modify the goConTurn procedure, you may be able to add new case statements for the up and down arrows to change the frequency.
Yes, that's what I thought to do.
Note there is not much dynamic memory left.... if you get erratic results you have a memory overflow condition and you will need to reduce the size of static strings (ie. Menu entries)
I have seen that space is getting really, really tight. But I have a couple of things in my head which will need much more than available, so I stripped out all the linear stuff, the devices, the safe to eeprom. My configuration is now done with a couple of #defines at the beginning. It's clearly not as flexible and configurable like yours.
My intended changes include:
- change speed within all different menus (not just continuous)
- add rotary enoder for direct turning
- add one of those IR remote controls
- maybe show RPM while turning (calculated, not measured)
I still remain true to all your core routines (apart from kicking out the globals variable) so we could still walk in parallel.
<><><><><>
Actually, I've got that a bit wrong. Speed is determined by the variable Operating_Hz
Well, no. Operating_Hz currently isn't used anywhere. At least not in v10. I have written a long reply regarding this, but deleted it. Basically this is the central function, as far as I can tell:
Code:
void setSpeed(int spdPct)
{
globals.maxStepperHz = (long)((float)( Operating_Hz - globals.minStepperHz) * (float)spdPct/100.0) + globals.minStepperHz;
globals.timerDelay = HzToTimeDelay(globals.maxStepperHz);
Timer1.setPeriod(globals.timerDelay); // set a timer of length in microseconds
}
You are modifying and operating around globals.maxStepperHz. Operating_Hz is just set once in setup() and never touched again. Because you are ramping to and from globals.maxStepperHz, and because Operating_Hz holds the MAX_FREQUENCY, it still works. So all is good functionality-wise, but by accident, so to speak.
Again thanks for sharing.
Happy days to you, Rod!