|
пре 2 дана | |
---|---|---|
HuzzahAPDistance | пре 2 недеља | |
static | пре 5 дана | |
templates | пре 6 дана | |
.gitignore | пре 1 недеља | |
README.md | пре 2 дана | |
app.py | пре 1 недеља | |
requirements.txt | пре 3 дана | |
run.sh | пре 2 дана | |
serve.sh | пре 2 дана |
This work involves a display and a distance sensor (HC-SR04).
$ cd HuzzahAPDistance
$ cp config.h.example config.h # and edit it with SSID and Password for the AP (pick something hard to guess)
Upload to the Huzzah board, and connect it to HC-SR04 like this:
Connect PC to the WiFi network you’ve defined at config.h
Browse to http://192.168.115.23. You should see a report of list of current client MAC addresses (typically, only yours), and a link to a JSON end point that returns distance.
$ virtualenv venv
$ . venv/bin/activate
$ pip install -r requirements.txt
$ cd ../static/js
$ cp config.js.example config.js # and edit it according to room size, etc.
$ ./serve.sh
This will start a localhost web server. You can see the work at http://localhost:5000/
You can also browse to http://localhost:5000/p to see distance as a progress bar (this can help callibrate static/js/config.js
according to room size).
$ ./run.sh
This will start the server and run a browser in kiosk mode.