diff --git a/documentation/Definitions.docx b/documentation/Definitions.docx index 38a5f32..29d85b1 100644 Binary files a/documentation/Definitions.docx and b/documentation/Definitions.docx differ diff --git a/documentation/Robot.docx b/documentation/Robot.docx index 35d38ad..dc6588f 100644 Binary files a/documentation/Robot.docx and b/documentation/Robot.docx differ diff --git a/software/roboter/ev3/drive_back.py b/software/roboter/ev3/drive_back.py new file mode 100644 index 0000000..8968f82 --- /dev/null +++ b/software/roboter/ev3/drive_back.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +from ev3dev2.motor import Motor, LargeMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent +from ev3dev2.sensor.lego import TouchSensor, UltrasonicSensor +from ev3dev2.sensor import INPUT_1, INPUT_4 +import sys + +motorLeft = LargeMotor(OUTPUT_D) +motorRight = LargeMotor(OUTPUT_A) +motorUpDown = Motor(OUTPUT_C) +motorLeftRight = Motor(OUTPUT_B) +ultraSensor = UltrasonicSensor(INPUT_4) +touchSensor = TouchSensor(INPUT_1) + +motorUpDown.on_for_seconds(SpeedPercent(-50), seconds=2.8) +motorLeftRight.on_for_degrees(SpeedPercent(int(sys.argv[1])), 400) + +motorLeft.on(SpeedPercent(-70), block=False) +motorRight.on(SpeedPercent(-70)) + +while True: + if ultraSensor.distance_centimeters < 10: + motorLeft.on(SpeedPercent(-25), block=False) + motorRight.on(SpeedPercent(-25)) + break + + + +touchSensor.wait_for_pressed(timeout_ms=None, sleep_ms=10) +motorLeft.off() +motorRight.off() \ No newline at end of file diff --git a/software/roboter/ev3/plant_1.py b/software/roboter/ev3/plant_1.py new file mode 100644 index 0000000..588f371 --- /dev/null +++ b/software/roboter/ev3/plant_1.py @@ -0,0 +1,15 @@ +#!/usr/bin/env pybricks-micropython + +from ev3dev2.motor import Motor, LargeMotor, ServoMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent + +motorRight = LargeMotor(OUTPUT_A) +motorLeft = LargeMotor(OUTPUT_D) +motorUpDown = Motor(OUTPUT_C) +motorLeftRight = Motor(OUTPUT_B) + +motorRight.on_for_seconds(SpeedPercent(70), seconds=0.8, block=False) +motorLeft.on_for_seconds(SpeedPercent(70), seconds=0.8) + +motorLeftRight.on_for_degrees(SpeedPercent(-50), 400) + +motorUpDown.on_for_seconds(SpeedPercent(50), seconds=2.8) diff --git a/software/roboter/ev3/plant_2.py b/software/roboter/ev3/plant_2.py new file mode 100644 index 0000000..9b50771 --- /dev/null +++ b/software/roboter/ev3/plant_2.py @@ -0,0 +1,16 @@ +#!/usr/bin/env pybricks-micropython + +from ev3dev2.motor import Motor, LargeMotor, ServoMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent + +motorRight = LargeMotor(OUTPUT_A) +motorLeft = LargeMotor(OUTPUT_D) +motorUpDown = Motor(OUTPUT_C) +motorLeftRight = Motor(OUTPUT_B) + +motorRight.on_for_seconds(SpeedPercent(70), seconds=0.8, block=False) +motorLeft.on_for_seconds(SpeedPercent(70), seconds=0.8) + +motorLeftRight.on_for_degrees(SpeedPercent(50), 400) + +motorUpDown.on_for_seconds(SpeedPercent(50), seconds=2.8) + diff --git a/software/roboter/ev3/plant_3.py b/software/roboter/ev3/plant_3.py new file mode 100644 index 0000000..8810f91 --- /dev/null +++ b/software/roboter/ev3/plant_3.py @@ -0,0 +1,16 @@ +#!/usr/bin/env pybricks-micropython + +from ev3dev2.motor import Motor, LargeMotor, ServoMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent + +motorRight = LargeMotor(OUTPUT_A) +motorLeft = LargeMotor(OUTPUT_D) +motorUpDown = Motor(OUTPUT_C) +motorLeftRight = Motor(OUTPUT_B) + +motorRight.on_for_seconds(SpeedPercent(70), seconds=2.2, block=False) +motorLeft.on_for_seconds(SpeedPercent(70), seconds=2.2) + +motorLeftRight.on_for_degrees(SpeedPercent(-50), 400) + +motorUpDown.on_for_seconds(SpeedPercent(50), seconds=2.8) + diff --git a/software/roboter/ev3/plant_4.py b/software/roboter/ev3/plant_4.py new file mode 100644 index 0000000..d7dd665 --- /dev/null +++ b/software/roboter/ev3/plant_4.py @@ -0,0 +1,15 @@ +#!/usr/bin/env pybricks-micropython + +from ev3dev2.motor import Motor, LargeMotor, ServoMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent + +motorRight = LargeMotor(OUTPUT_A) +motorLeft = LargeMotor(OUTPUT_D) +motorUpDown = Motor(OUTPUT_C) +motorLeftRight = Motor(OUTPUT_B) + +motorRight.on_for_seconds(SpeedPercent(70), seconds=2.2, block=False) +motorLeft.on_for_seconds(SpeedPercent(70), seconds=2.2) + +motorLeftRight.on_for_degrees(SpeedPercent(50), 400) + +motorUpDown.on_for_seconds(SpeedPercent(50), seconds=3) diff --git a/software/roboter/ev3/plant_5.py b/software/roboter/ev3/plant_5.py new file mode 100644 index 0000000..bc42413 --- /dev/null +++ b/software/roboter/ev3/plant_5.py @@ -0,0 +1,16 @@ +#!/usr/bin/env pybricks-micropython + +from ev3dev2.motor import Motor, LargeMotor, ServoMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent + +motorRight = LargeMotor(OUTPUT_A) +motorLeft = LargeMotor(OUTPUT_D) +motorUpDown = Motor(OUTPUT_C) +motorLeftRight = Motor(OUTPUT_B) + +motorRight.on_for_seconds(SpeedPercent(70), seconds=2.7, block=False) +motorLeft.on_for_seconds(SpeedPercent(70), seconds=2.7) + +motorLeftRight.on_for_degrees(SpeedPercent(-50), 400) + +motorUpDown.on_for_seconds(SpeedPercent(50), seconds=3) + diff --git a/software/roboter/ev3/plant_6.py b/software/roboter/ev3/plant_6.py new file mode 100644 index 0000000..1d9b6c9 --- /dev/null +++ b/software/roboter/ev3/plant_6.py @@ -0,0 +1,16 @@ +#!/usr/bin/env pybricks-micropython + +from ev3dev2.motor import Motor, LargeMotor, ServoMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent + +motorRight = LargeMotor(OUTPUT_A) +motorLeft = LargeMotor(OUTPUT_D) +motorUpDown = Motor(OUTPUT_C) +motorLeftRight = Motor(OUTPUT_B) + +motorRight.on_for_seconds(SpeedPercent(70), seconds=2.7, block=False) +motorLeft.on_for_seconds(SpeedPercent(70), seconds=2.7) + +motorLeftRight.on_for_degrees(SpeedPercent(50), 400) + +motorUpDown.on_for_seconds(SpeedPercent(50), seconds=3) +