You can not 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 dfd1a7a9fd remove unneeded line 2 years ago
code remove unneeded line 2 years ago
.gitignore Ignore /.env/ dir 2 years ago
Makefile Remove boot.py, shouldn't need to change that anyways 2 years ago
README.org Rename move() to triggerRelay() 2 years ago
default.nix Add deps 2 years ago
requirements.txt Added requirements.txt 2 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()

table.triggerRelay(0)

table.triggerRelay(1)

table.triggerRelay(-1)

import main main.goCrazy()