diff --git a/Arduino rudders stepper/arduino_rudder_stepper/arduino_rudder_stepper.ino b/Arduino rudders stepper/arduino_rudder_stepper/arduino_rudder_stepper.ino new file mode 100644 index 0000000..46ef823 --- /dev/null +++ b/Arduino rudders stepper/arduino_rudder_stepper/arduino_rudder_stepper.ino @@ -0,0 +1,80 @@ +/* + Button + + Turns on and off a light emitting diode(LED) connected to digital pin 13, + when pressing a pushbutton attached to pin 2. + + The circuit: + - LED attached from pin 13 to ground through 220 ohm resistor + - pushbutton attached to pin 2 from +5V + - 10K resistor attached to pin 2 from ground + + - Note: on most Arduinos there is already an LED on the board + attached to pin 13. + + created 2005 + by DojoDave + modified 30 Aug 2011 + by Tom Igoe + + This example code is in the public domain. + + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Button +*/ + +#include + +// constants won't change. They're used here to set pin numbers: +const int buttonPin = 14; // the number of the pushbutton pin +const int buttonPin2 = 15; +const int ledPin = 13; // the number of the LED pin +int check_stopped = 1; + +AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 + +// variables will change: +int buttonState1 = 0; // variable for reading the pushbutton status +int buttonState2 = 0; + +void setup() { + // initialize the LED pin as an output: + Serial.begin(115200); + pinMode(ledPin, OUTPUT); + // initialize the pushbutton pin as an input: + pinMode(buttonPin, INPUT_PULLUP); + pinMode(buttonPin2, INPUT_PULLUP); + stepper.setMaxSpeed(1000); +} + +void loop() { + // read the state of the pushbutton value: + buttonState1 = digitalRead(buttonPin); + buttonState2 = digitalRead(buttonPin2); + + + // check if the pushbutton is pressed. If it is, the buttonState is HIGH: + if (buttonState1 ==LOW && buttonState2 == LOW) { + Serial.println("Both pressed"); + } + else if (buttonState1 == LOW && buttonState2 == HIGH) { + //Serial.println("B2 pressed"); + //Serial.println(check_stopped); + stepper.enableOutputs(); + check_stopped = 1; + stepper.setSpeed(1000); + stepper.runSpeed(); + } + else if (buttonState1 == HIGH && buttonState2 == LOW) { + check_stopped = 1; + //Serial.println("B1 pressed"); + //Serial.println(check_stopped); + stepper.enableOutputs(); + stepper.setSpeed(-1000); + stepper.runSpeed(); + } + else if (stepper.isRunning()) { + stepper.stop(); + stepper.disableOutputs(); + stepper.enableOutputs(); + } +} diff --git a/External Parts/MicroPro_base.stl b/External Parts/MicroPro_base.stl new file mode 100644 index 0000000..11e6da7 Binary files /dev/null and b/External Parts/MicroPro_base.stl differ diff --git a/Rudders/Electronics_Cover.FCStd b/Rudders/Electronics_Cover.FCStd new file mode 100644 index 0000000..c223904 Binary files /dev/null and b/Rudders/Electronics_Cover.FCStd differ diff --git a/Rudders/Mounts.FCStd b/Rudders/Mounts.FCStd new file mode 100644 index 0000000..6a1fea2 Binary files /dev/null and b/Rudders/Mounts.FCStd differ diff --git a/Rudders/bearing Holder.FCStd b/Rudders/bearing Holder.FCStd new file mode 100644 index 0000000..dd8682b Binary files /dev/null and b/Rudders/bearing Holder.FCStd differ