Cov txheej txheem:

Tshuav, Ntse Nyhav Nplai: 7 Kauj Ruam
Tshuav, Ntse Nyhav Nplai: 7 Kauj Ruam

Video: Tshuav, Ntse Nyhav Nplai: 7 Kauj Ruam

Video: Tshuav, Ntse Nyhav Nplai: 7 Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Hlis ntuj nqeg
Anonim
Tshuav, Ntse Nyhav Nplai
Tshuav, Ntse Nyhav Nplai

Nyob zoo! Hnub no kuv yuav sim thiab qhia koj yuav ua li cas ntsuas qhov hnyav hnyav los ntawm kos!

Kauj Ruam 1: Cheeb Tsam

Cheebtsam
Cheebtsam

Cov khoom koj yuav xav tau:

  • A 'Wii Tshuav Pawg Thawj Coj'
  • Raspberry Pi 3, muab nrog Bluetooth (lossis ua ntej version ntawm RPi, suav nrog Bluetooth Dongle)
  • Ib qho 16x2 LCD Screen
  • Qee qhov nyob ib puag ncig cov xov hluav taws xob (Ua ntej. Poj niam-Poj niam, tab sis siv qee cov xov hlau ib yam nkaus)

Rau cov ntoo ntoo kuv siv 6 ntu ntoo (saib duab kom ntxaws ntxaws qhov ntev ntoo.) Cov ntoo ntoo/cav kuv siv muaj qhov dav thiab qhov siab ntawm 4, 5 cm, thiab ntev 140 cm (koj yuav tsum muaj yam tsawg 2 ntawm cov kab no.). Kuv kuj siv lub rooj ntoo ntoo hauv qab (67x47cm).

Yam ntxiv uas koj xav tau:

  • Pom (tsis muaj teeb meem dab tsi, tsuas yog siv ib qho uas koj paub nrog)
  • Ntoo kua nplaum
  • ib lub thawv ntawv/lub thawv ntoo nrog qhov dav ntawm 16 cm (TSEEM CEEB: Koj li RPi thiab cov zaub yuav nyob ntawm no, yog li xyuas kom nws muaj qhov siab zoo & muaj peev xwm rau koj lub vijtsam kom haum.)

*Yam ntxiv koj tseem tuaj yeem ntxiv:

  • Coj strips nyob rau sab hauv ntawm tus ncej
  • Xim / xim rau ntoo & / lossis pawg thawj coj saib
  • Kuv yuav zaum hloov kho txoj haujlwm no lub hlis tom ntej lossis qee yam, Kuv yuav hloov kho txoj haujlwm no nrog cov ntsuas hluav taws xob kom koj tuaj yeem paub tias ko taw nyob ntawm lub rooj tsavxwm lossis tsis.

Kauj ruam 2: Kho vajtse

Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse

Tam sim no koj xav kom ntseeg tau tias koj li RPi txuas nrog rau koj lub LCD. Koj tsis xav tau lub zog ntsuas, koj kuj tseem yuav cia nws txuas rau 5V/GND, tab sis nws zoo dua yog tias koj xav tswj qhov sib txawv ntawm tus kheej.

Koj kuj tseem pom lub logic pawg thawj coj ntawm Wii Pawg Thawj Tswj Hwm, tsuas yog muab tswv yim rau koj tias nws ua haujlwm li cas.

Ua:

Solder 5V & GND rau roj teeb lub logic board, txoj hauv kev no koj yuav tsis xav tau roj teeb ntxiv lawm

Kauj Ruam 3: Teeb RPi

Kev teeb tsa RPi
Kev teeb tsa RPi

Kev teeb tsa RPi:

  1. Kev teeb tsa lub network, nco ntsoov tias koj tuaj yeem txuas rau Wi-nkaus. APIPA hauv bootconfig -> teeb tsa wlan ntawm putty -> pab kom bluetooth hauv raspi -teeb tsa
  2. Ua daim nplaub tshev ntawm koj RPi (hauv qhov piv txwv no, Kuv tau ua daim nplaub tshev 'Project' nyob hauv /home /pi.

Kauj Ruam 4: Tswj Koj Cov Sensors

Tam sim no uas kho vajtse tiav, cia peb pib coding cov khoom. Rau LCD, peb tab tom siv adafruit LCD cov ntaub ntawv raws li basefile. Hauv LCD.py cov ntaub ntawv, koj tuaj yeem tso saib wlan IP ntawm koj li RPi ntawm cov zaub. Qee zaum koj tuaj yeem tso koj qhov hnyav.

Kauj ruam 5: Database

Kauj Ruam 1: tsim cov ntaub ntawv nrog 3 lub rooj, Tus Neeg Siv, Qhov hnyav, Lub Hom Phiaj

Kauj Ruam 2: hauv cov ntxhuav no koj tsim kab ntawv:

  1. Tus neeg siv: Tus username, password, ntev, hnub nyoog, lub npe, lub xeem, poj niam txiv neej
  2. Nyhav: WeightID (ai), Nyhav, Ntsuas Sijhawm, tus neeg siv_username (fk)
  3. Target: Targetid, targetweight, targetmadedate, targetdate, targetreached, piav qhia, user_usernam

Nruab qhov no hauv mariaDB ntawm rpi, nco ntsoov tias koj muab txhua txoj cai rau txhua tus neeg siv tsim.

Kauj Ruam 6: Lub Vev Xaib Nrog Flask

Koj tuaj yeem tau txais lub vev xaib tiav los ntawm no:

koj yuav tsum paub tseeb tias cov qauv nyob hauv daim nplaub tshev template (kos ua daim nplaub tshev template!), Nco ntsoov tias hrefs yog O K nrog cov url sib xws.

Pom zoo: