Go to file
Elis Axelsson dfd1a7a9fd remove unneeded line 2017-08-26 19:20:55 +02:00
code remove unneeded line 2017-08-26 19:20:55 +02:00
.gitignore Ignore /.env/ dir 2017-07-24 17:45:46 +02:00
Makefile Remove boot.py, shouldn't need to change that anyways 2017-08-24 08:09:38 +02:00
README.org Rename move() to triggerRelay() 2017-08-21 19:56:41 +02:00
default.nix Add deps 2017-07-24 17:19:09 +02:00
requirements.txt Added requirements.txt 2017-07-24 17:35:20 +02:00

README.org

Setup

nix-shell --command fish
virtualenv --no-site-packages --distribute .env
source .env/bin/activate.fish
pip install -r requirements.txt
# Copy files
make copy

# Connect to serial port
make connect

How to connect things

Distance measuring

HCSR04 Pins

Pin on component Pin on card
Trig D2
Echo D3
Vcc 5V
GND GND

Set up distance measuring

from table import Table

table = Table()

while True:
    print(table.currentHeight())
    time.sleep(1)

Movement sensor

Sensor pins

Pin on component Pin on card
5V 5V
GND GND
OUT D4

Set up movement sensor

from table import Table

table = Table()

while True:
    print(table.getMovement())
    time.sleep(0.5)

Relay

Pins

Pin on component Pin on card
Vcc 5V
Gnd GND
In1 D5
In2 D6

Set up relays

from table import Table

table = Table()

# Reset relays
table.triggerRelay(0)

# Move table up
table.triggerRelay(1)

# Move table down
table.triggerRelay(-1)

# To go up and down and measure distance and stuff at the same time
import main
main.goCrazy()