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.
 
 
 
tablecontrol/README.org

61 lines
1.3 KiB

* Setup
#+BEGIN_SRC sh
virtualenv --no-site-packages --distribute .env
source .env/bin/activate
pip install -r requirements.txt
#+END_SRC
* Connect to serial port
#+BEGIN_SRC sh
picocom /dev/ttyUSB0 -b115200
#+END_SRC
* Copying file
#+BEGIN_SRC sh
ampy --port /dev/ttyUSB0 put hcsr04.py
#+END_SRC
* 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
#+begin_src python
import main, time
while True:
print(main.getDistance())
time.sleep(1)
#+end_src
** Movement sensor
*** Sensor pins
| Pin on component | Pin on card |
|------------------+-------------|
| 5V | 5V |
| GND | GND |
| OUT | D4 |
*** Set up movement sensor
#+begin_src python
import main, time
while True:
print(main.getMovement())
time.sleep(0.5)
#+end_src
** Relay
*** Pins
| Pin on component | Pin on card |
|------------------+-------------|
| Vcc | 5V |
| Gnd | GND |
| In1 | D5 |
| In2 | D6 |