created first draft of wheel class

This commit is contained in:
d3rped 2018-03-18 15:05:23 +01:00
parent 5b787bc400
commit 2fdb165f6d

View file

@ -5,13 +5,24 @@ class Wheel:
def __init__(self, port):
self._motor = ev3.LargeMotor(port)
self._motor.stop_action = 'brake'
self._speed = 50
self._speed = 20
self._motor.duty_cycle_sp = self._speed
def run(self):
pass
self._motor.run_direct()
def stop(self):
pass
self._motor.stop()
def speed_set(self):
pass
def speed_set(self, newspeed):
self._speed = newspeed
self._motor.duty_cycle_sp = self._speed
def speed_mod(self, modifier):
self._speed = self._speed + modifier
self._motor.duty_cycle_sp = self._speed
def getmovement(self):
self.position = self._motor.position
self._motor.position.reset()
return self.position