Skip to content

Commit

Permalink
fixing typos
Browse files Browse the repository at this point in the history
  • Loading branch information
AIIrondev committed Mar 7, 2024
1 parent e5bfedb commit 9a2d925
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Code/calibration.fll
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#Calibrate function
async def calibrate(speed=1000, acceleration=1000):
if (distance_sensor.distance(port.C) < 110):
if distance_sensor.distance(port.C) < 110:
print("Calibration not possible! | Distance to small!")
elif (distance_sensor.distance(port.C) > 110):
elif distance_sensor.distance(port.C) > 110:
try:
await drive(-1, 14, speed, acceleration)
distance0 = distance_sensor.distance(port.C)
Expand Down
6 changes: 3 additions & 3 deletions Code/module.fll
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#Module function
async def module(degrees=0, speed=1110, acceleration=10000):
if (degrees > 0):
if degrees > 0:
await motor.run_for_degrees(motor_module, degrees, speed, acceleration=acceleration)
elif (degrees < 0):
elif degrees < 0:
await motor.run_for_degrees(motor_module, degrees, speed, acceleration=acceleration)
elif (degrees == 0):
elif degrees == 0:
print("Error")
16 changes: 8 additions & 8 deletions Code/motor.fll
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
#Drive function
async def drive(distance=0, multiplier=14, speed=1000, acceleration=1000):
if (distance > 0):
if distance > 0:
degrees = multiplier*(distance - calibration)
await motor_pair.move_for_degrees(pair, degrees, 0, velocity=speed, acceleration=acceleration)
elif (distance < 0):
elif distance < 0:
degrees = multiplier*(distance + calibration)
await motor_pair.move_for_degrees(pair, degrees, 0, velocity=speed, acceleration=acceleration)
elif (distance == 0):
elif distance == 0:
print("Bist du dumm?")

#Tank function
async def tank(degrees=0, left_speed=1000, right_speed=1000, acceleration=1000):
#180 degrees = 90 Grad
if (degrees > 0):
if degrees > 0:
await motor_pair.move_tank_for_degrees(pair, -degrees, left_speed, -right_speed, acceleration=acceleration)
elif (degrees < 0):
elif degrees < 0:
await motor_pair.move_tank_for_degrees(pair, degrees, -left_speed, right_speed, acceleration=acceleration)
elif (degrees == 0):
elif degrees == 0:
print("Bist du dumm?")

#Obstacle function
async def obstacle(distance=0, speed=1000, acceleration=1000):
if (distance > 0):
if distance > 0:
while distance_sensor.distance(port.C) > distance:
await drive(2, 14, speed, acceleration)
print("Obstacle detected!")
#print(distance_sensor.distance(port.C))
elif (distance <= 0):
elif distance <= 0:
print("Bist du dumm?")
2 changes: 1 addition & 1 deletion Code/sensor.fll
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Switch function
async def switch(switch=False):
while switch == False:
if (force_sensor.force(force_module) >= 50):
if force_sensor.force(force_module) >= 50:
switch = True
return True

0 comments on commit 9a2d925

Please sign in to comment.