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 01ada69bdc Added docs about movement sensor 5 years ago
tablecode Add main file with example to measure distance 5 years ago
.gitignore Ignore /.env/ dir 5 years ago
README.org Added docs about movement sensor 5 years ago
default.nix Add deps 5 years ago
hcsr04.py Add lib 5 years ago
requirements.txt Added requirements.txt 5 years ago

README.org

Setup

virtualenv --no-site-packages --distribute .env
source .env/bin/activate
pip install -r requirements.txt

Connect to serial port

picocom /dev/ttyUSB0 -b115200

Small card

Distance measuring

HCSR04 Pins

Trig – D0 Echo – D3 Vcc – 5V GND – GND

Set up distance measuring

import tablecode.main

tablecode.main.distance(16, 0)

Movement sensor

Sensor pins

5V – 5V GND – GND OUT – D0

Set up movement sensor

import machine

pin = machine.Pin(0, mode=machine.Pin.IN, pull=None)

print(pin.value())