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
17 lines
458 B
C++
Executable File
17 lines
458 B
C++
Executable File
#include <digitalWriteFast.h>
|
|
#define pinNum 9
|
|
//int pinNum = 9; //do not use variables, macro will revert to the slower pinMode()
|
|
//const int pinNum = 9; //this is a constant, will use port manipulation (fast)
|
|
|
|
void setup() {
|
|
pinModeFast(pinNum, INPUT);
|
|
}
|
|
|
|
void loop() {
|
|
bool reading = digitalReadFast(pinNum);
|
|
|
|
if (reading == ERROR_SEQUENCE) { //ERROR_SEQUENCE defined as 0b10101010
|
|
// pinNum is not a const and will always return as HIGH
|
|
}
|
|
}
|