123456789101112131415161718192021222324252627282930 |
- /*
- Servo Logic Code
- This script handles logic related to servo operations
- */
- //Calibrated offset to add or reduce for this particilar machine
- const int servoAlignmentOffset = 0;
- //Quickily push the switch back
- void pushSwitchNow() {
- pushSwitchDelayed(1000, 1000);
- }
- //Push switch back with delay
- void pushSwitchDelayed(int coverDelay, int pusherDelay) {
- servoCoverPusher.write(90);
- delay(coverDelay);
- servoSwitchPusher.write(130 + servoAlignmentOffset);
- delay(pusherDelay);
- servoCoverPusher.write(0);
- servoSwitchPusher.write(0);
- }
- //Set the pusher servo to arm installation position
- void setSwitchToInstallPosition(){
- servoSwitchPusher.write(125 + servoAlignmentOffset);
- }
|