diff --git a/README.org b/README.org index 1e00cf9..4aed77a 100644 --- a/README.org +++ b/README.org @@ -70,13 +70,13 @@ from table import Table table = Table() # Reset relays -table.move(0) +table.triggerRelay(0) # Move table up -table.move(1) +table.triggerRelay(1) # Move table down -table.move(-1) +table.triggerRelay(-1) # To go up and down and measure distance and stuff at the same time import main diff --git a/code/table.py b/code/table.py index 7636aa4..7c1132d 100644 --- a/code/table.py +++ b/code/table.py @@ -16,7 +16,7 @@ class Table: self.relay_down = machine.Pin(pins.D6, mode=machine.Pin.OUT) # Reset both relays on set up - self.move(0) + self.triggerRelay(0) def currentHeight(self): @@ -40,7 +40,7 @@ class Table: return self.movement_sensor.value() - def move(self, direction): + def triggerRelay(self, direction): """ Direction should be an integer: - 1 to move up