You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Elis Axelsson b1101d0405 Remove boot.py, shouldn't need to change that anyways 6 years ago
code Remove boot.py, shouldn't need to change that anyways 6 years ago
.gitignore Ignore /.env/ dir 6 years ago
Makefile Remove boot.py, shouldn't need to change that anyways 6 years ago
README.org Rename move() to triggerRelay() 6 years ago
default.nix Add deps 6 years ago
requirements.txt Added requirements.txt 6 years ago

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()