Commit d5e64915 authored by Felix Kettner's avatar Felix Kettner

pep8

parent b75d1121
Pipeline #34322 passed with stage
in 28 seconds
......@@ -50,22 +50,18 @@ class Nano:
else:
print("Battery voltage okay! ({} mV)".format(voltage))
def set_stat_led(self, toggle):
write_order(self.serial_file, order=Order.STAT_LED)
write_i8(self.serial_file, toggle)
def open_gripper(self):
write_order(self.serial_file, order=Order.GRIPPER)
write_i8(self.serial_file, 0)
def close_gripper(self):
write_order(self.serial_file, order=Order.GRIPPER)
write_i8(self.serial_file, 1)
def set_motors(self, left, right):
write_order(self.serial_file, order=Order.MOTORS)
# Write left
......@@ -73,7 +69,6 @@ class Nano:
# Write right
write_i8(self.serial_file, clamp(right, -128, 127))
def get_encoders(self):
write_order(self.serial_file, order=Order.GET_ENCODERS)
......@@ -82,7 +77,6 @@ class Nano:
right = read_i16(self.serial_file)
return left, right
def get_line_sensors(self):
write_order(self.serial_file, order=Order.GET_LINE_SENSORS)
......@@ -92,7 +86,6 @@ class Nano:
right = read_i16(self.serial_file)
return left, mid, right
def reset_encoders(self):
write_order(self.serial_file, order=Order.RESET_ENCODERS)
......@@ -101,7 +94,6 @@ class Nano:
write_order(self.serial_file, order=Order.VOLTAGE)
return read_i16(self.serial_file)
def get_distances(self):
write_order(self.serial_file, order=Order.DISTANCES)
......@@ -111,7 +103,6 @@ class Nano:
right = read_ui8(self.serial_file)
return left, mid, right
def set_buzzer(self, freq, duration):
write_order(self.serial_file, order=Order.BUZZER)
# send the frequency
......@@ -119,7 +110,6 @@ class Nano:
# send the duration
write_ui16(self.serial_file, duration)
def get_color_rgb(self):
# red
GPIO.output(c.COLOR_SENSOR_S2,GPIO.LOW)
......@@ -141,7 +131,6 @@ class Nano:
return red, green, blue
def get_color(self):
# red
GPIO.output(c.COLOR_SENSOR_S2,GPIO.LOW)
......@@ -170,7 +159,6 @@ class Nano:
else:
return "none"
@staticmethod
def reset_nano():
GPIO.setmode(GPIO.BCM)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment