Hello
I am running a stepper motor and to step it, you need to send the signal high, short delay and then low - so you basically need to pulse.
I`m currently running with a delay:
loop:
write step pin HIGH;
delay (10);
write step pin LOW;
delay (10);
sudo code, but you get the idea. High, delay, low .... but the number of times it does this is critical as it dictates how many steps it will make. I`ve done a similar thing on a microcontroller with MikroC stuff and I (some how, I`m fairly new to this!) managed to get the above code running in an interrupt. That way I knew it was ALWAYS going to be running. Then I did an if statement within the interrupt to check wheather it should actually use the code and step motor:
That way I could guarantee that how ever big my code was and whatever else it was trying to do in the main section, it would always step the motor when I told it to as it was always jumping to the step/interrupt routine.
I`m really struggling to do this using Arduino. A simple one would be to just blink an LED using a count triggered interrupt rather than a delay.
Could anyone tell me if this is possible? How could I simply blink an LED say every second in an interrupt? Then the next step would be to blink the LED every 10ms (you obviously couldn`t see it!) using the interrupt.
Any help appreciated!
Chris