commit 85eed65c847d6f12a7c4e851d3fe6ce36f8b51e7 Author: adrian Date: Sat Jan 24 18:11:31 2026 +0100 first commit diff --git a/arm-unten-Body.stl b/arm-unten-Body.stl new file mode 100644 index 0000000..d45f9a5 Binary files /dev/null and b/arm-unten-Body.stl differ diff --git a/sketch_jan18a.ino b/sketch_jan18a.ino new file mode 100644 index 0000000..46ecd72 --- /dev/null +++ b/sketch_jan18a.ino @@ -0,0 +1,49 @@ +#include + +Servo ServoBase; +Servo ServoArmOne; +const int SW_pin = 10; +const int X_pin = A1; +const int Y_pin = A0; + +void setup () { + ServoBase.attach(13); + ServoArmOne.attach(12); + Serial.begin(9600); + pinMode(SW_pin, INPUT); + digitalWrite(SW_pin, HIGH); +} + +void loop() { + bool SW = digitalRead(SW_pin); + if (!SW) { + ServoBase.write(90); + } + + int Y_State = analogRead(Y_pin); + moveBase(Y_State); + +/* + Serial.print("Switch: "); + Serial.print(digitalRead(SW_pin)); + Serial.print("\n"); + Serial.print("X-axis: "); + Serial.print(analogRead(X_pin)); + Serial.print("\n"); + Serial.print("Y-axis: "); + Serial.println(analogRead(Y_pin)); + Serial.print("\n\n"); + delay(500); + */ + +} + +void moveBase(int pos) { + int newServoPos = pos * 0.1761; + ServoBase.write(newServoPos); + Serial.print(newServoPos); + Serial.print("\n"); + Serial.print(pos); + Serial.print("\n"); +} +