Cov txheej txheem:

Web-based SmartMirror Siv Kev Sib Txuas Lus: 6 Kauj Ruam
Web-based SmartMirror Siv Kev Sib Txuas Lus: 6 Kauj Ruam

Video: Web-based SmartMirror Siv Kev Sib Txuas Lus: 6 Kauj Ruam

Video: Web-based SmartMirror Siv Kev Sib Txuas Lus: 6 Kauj Ruam
Video: Python! Reading and Writing JSON Files 2024, Lub Xya hli ntuj
Anonim
Web-based SmartMirror Siv Kev Sib Txuas Lus
Web-based SmartMirror Siv Kev Sib Txuas Lus

Cov lus qhia no tau xa nrog txhua cov cai npaj siv. Txoj kev txhim kho tau nyuaj heev tab sis ib zaug nws tau teeb tsa nws yooj yim heev rau kev kho.

Ua tibzoo saib thiab txaus siab;)

Kauj ruam 1: Kho koj li Arduino

Configurating Koj Arduino
Configurating Koj Arduino
Configurating Koj Arduino
Configurating Koj Arduino

Ua ntej tshaj plaws koj yuav tsum teeb tsa koj li arduino.

Cia peb pib nrog txuas SRF Sensor rau koj cov arduino. Hauv daim duab saum toj no koj tuaj yeem pom li cas kuv txuas SRF rau kuv arduino.

Hauv zipfile koj yuav pom tus lej Arduino txhawm rau upload rau koj Arduino. Thaum koj ua raws txoj cai no thiab qhib cov ntawv saib hauv Arduino IDE koj yuav tsum pom "0" thaum koj nyob deb tshaj 1 meter thiab "1" thaum koj nyob hauv ib lub 'meter' ntawm lub sensor.

Koj tuaj yeem hloov cov lej no tab sis nws yooj yim dua nyeem tom qab.

Kauj Ruam 2: Txhim Kho Node.js thiab Khiav Websocket

Txhim Kho Node.js thiab Khiav Websocket
Txhim Kho Node.js thiab Khiav Websocket
Txhim Kho Node.js thiab Khiav Websocket
Txhim Kho Node.js thiab Khiav Websocket

Ua ntej peb tuaj yeem xa cov ntaub ntawv mus rau peb qhov browser ib puag ncig peb yuav xav tau teeb tsa Node. JS.

Yog tias tau teeb tsa koj qhib koj cov lus txib tam sim thiab mus rau koj li Smartmirror nplaub tshev

$ cd Desktop/SmartMirror

Tam sim no koj nyob hauv daim nplaub tshev uas koj ua ntawv index.js uas tau muab hauv ZIP.

$ node index.js

Feem ntau koj yuav tsum pom "0" thiab "1" los ntawm koj lub sensor tam sim no.

NCO TSEG:

sab hauv index.js koj yuav zaum tau hloov koj qhov chaw nres nkoj. Kuv tau teeb tsa hauv COM6. Txheeb xyuas koj li arduino IDE uas koj tus arduino txuas nrog.

var myPort = tshiab SerialPort ('COM6', {baudRate: 9600});

Kauj Ruam 3: Qhib Lub Vev Xaib

Qhib Lub Vev Xaib
Qhib Lub Vev Xaib

Sab hauv lub vev xaib Kuv teeb tsa ob peb API zoo li lub moos, huab cua, thiab lwm yam.

Qhib cov ntaub ntawv index.html hauv daim ntawv qhia pej xeem thiab koj yuav pom hauv koj li Command Prompt "txuas tshiab".

Yog tias txhua yam ua haujlwm raws li nws yuav tsum cov ntawv yuav tsum pib (dis) tshwm sim yog tias koj nyob hauv ib lub 'meter' lossis tsis yog.

Kauj Ruam 4: Lasercut Casing

Lasercut Casing
Lasercut Casing
Lasercut Casing
Lasercut Casing

Kuv kuj tau muab kuv tus kheej tus qauv rau lub casing tab sis koj tuaj yeem tsim koj li vim tias tej zaum koj yuav muaj lwm tus saib dua kuv.

Thaum koj txiav nws tawm, koj sib sau ua ke thiab zais tag nrho cov kab hluav taws xob.

Kauj ruam 5: Ua tiav

Yog tias txhua yam mus raws li tau npaj tseg tam sim no koj yuav tsum muaj koj lub ntsej muag ntse!

Kauj Ruam 6: Cov Lus Qhia

Koj tuaj yeem ua kom nws ntau dua thiab tsis muaj wireless yog tias koj siv Raspberry Pi. Qhov no yuav yog cov kab hluav taws xob tsawg dua thiab txav tau ntau dua.

Pom zoo: