mirror of
https://github.com/k3ng/k3ng_rotator_controller.git
synced 2025-01-01 10:56:45 +00:00
56e6ed8233
FEATURE_STEPPER_MOTOR Removed OPTION_STEPPER_MOTOR_MAX_50_KHZ. Too much overhead from interrupts. Implemented faster digital writes using digitalWriteFast library (library now included in Github) Added OPTION_STEPPER_DO_NOT_USE_DIGITALWRITEFAST_LIBRARY to disable digitalWriteFast library use
38 lines
1.1 KiB
C++
Executable File
38 lines
1.1 KiB
C++
Executable File
#define pinNum 9
|
|
//int pinNum = 9; //for regular digitalWrite(), does matter constant or variable
|
|
//const int pinNum = 9; //this is a constant
|
|
|
|
void setup() {
|
|
pinMode(pinNum, OUTPUT);
|
|
}
|
|
|
|
void loop() {
|
|
//digitalWrite is so slow that , you don't actually need to toggle multiple times in 1 loop
|
|
// because digitalWrite takes 6280ns but to return to the start of loop takes only 600ns.
|
|
// this only makes a big deal when using digitalWriteFast(pinNum, state);
|
|
digitalWrite(pinNum, HIGH);
|
|
digitalWrite(pinNum, LOW);
|
|
digitalWrite(pinNum, HIGH);
|
|
digitalWrite(pinNum, LOW);
|
|
digitalWrite(pinNum, HIGH);
|
|
digitalWrite(pinNum, LOW);
|
|
digitalWrite(pinNum, HIGH);
|
|
digitalWrite(pinNum, LOW);
|
|
digitalWrite(pinNum, HIGH);
|
|
digitalWrite(pinNum, LOW);
|
|
digitalWrite(pinNum, HIGH);
|
|
digitalWrite(pinNum, LOW);
|
|
digitalWrite(pinNum, HIGH);
|
|
digitalWrite(pinNum, LOW);
|
|
digitalWrite(pinNum, HIGH);
|
|
digitalWrite(pinNum, LOW);
|
|
digitalWrite(pinNum, HIGH);
|
|
digitalWrite(pinNum, LOW);
|
|
digitalWrite(pinNum, HIGH);
|
|
digitalWrite(pinNum, LOW);
|
|
digitalWrite(pinNum, HIGH);
|
|
digitalWrite(pinNum, LOW);
|
|
digitalWrite(pinNum, HIGH);
|
|
digitalWrite(pinNum, LOW);
|
|
}
|