Browse Source

Rename move() to triggerRelay()

master
Elis Axelsson 4 years ago
parent
commit
2fb13b33cb
  1. 6
      README.org
  2. 4
      code/table.py

6
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

4
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

Loading…
Cancel
Save