mirror of
https://github.com/k3ng/k3ng_rotator_controller.git
synced 2025-02-03 09:30:41 +00:00
b1be2b7e6b
Added OPTION_STEPPER_MOTOR_USE_TIMER_ONE_INSTEAD_OF_FIVE for FEATURE_STEPPER_MOTOR. Also added TimerOne library to Github.
26 lines
674 B
Plaintext
Executable File
26 lines
674 B
Plaintext
Executable File
#include <TimerOne.h>
|
|
|
|
void setup()
|
|
{
|
|
// Initialize the digital pin as an output.
|
|
// Pin 13 has an LED connected on most Arduino boards
|
|
pinMode(13, OUTPUT);
|
|
|
|
Timer1.initialize(100000); // set a timer of length 100000 microseconds (or 0.1 sec - or 10Hz => the led will blink 5 times, 5 cycles of on-and-off, per second)
|
|
Timer1.attachInterrupt( timerIsr ); // attach the service routine here
|
|
}
|
|
|
|
void loop()
|
|
{
|
|
// Main code loop
|
|
// TODO: Put your regular (non-ISR) logic here
|
|
}
|
|
|
|
/// --------------------------
|
|
/// Custom ISR Timer Routine
|
|
/// --------------------------
|
|
void timerIsr()
|
|
{
|
|
// Toggle LED
|
|
digitalWrite( 13, digitalRead( 13 ) ^ 1 );
|
|
} |