Cov txheej txheem:

Tsav koj RaspberryPi: 6 Kauj Ruam
Tsav koj RaspberryPi: 6 Kauj Ruam

Video: Tsav koj RaspberryPi: 6 Kauj Ruam

Video: Tsav koj RaspberryPi: 6 Kauj Ruam
Video: Koj pom Los xyov koj pua paub 2024, Lub Xya hli ntuj
Anonim
Tsav koj RaspberryPi
Tsav koj RaspberryPi

Cov lus qhia no yuav ntxiv lub log rau koj Raspberry pi kom koj tuaj yeem nqa koj txoj haujlwm uas tsis muaj transistor tau ua ntej.

Phau ntawv qhia no yuav taug kev koj los ntawm cov txheej txheem ntawm yuav ua li cas tswj cov motors los ntawm Wi-nkaus Network. Raws li txoj haujlwm no tau tsim los siv cov khoom seem los ntawm lub thawv nto npe ntawm cov yas tsis muaj qhov uas kuv khaws cia yam tsis muaj laj thawj, koj yuav xav siv qee qhov kev muaj tswv yim los txheeb xyuas txoj hauv kev zoo tshaj plaws los txuas cov khoom no ua ke thiab tsim koj lub rover.

Khoom siv:

  • Raspberry Pi Zero W.
  • L293D ua
  • DC 3V-6V DC Gear Tsav rau Arduino 3
  • Ntse Neeg Hlau Tsheb Log
  • Dhia xov hlau
  • USB cable
  • Lub roj teeb tuav (4 AA roj teeb)
  • Cov qhob cij
  • Soldering Hlau
  • Screws, kab xev, kua nplaum, txhua yam uas tuav cov khoom ua ke.

Kauj Ruam 1: Kev Txuas Hluav Taws Xob rau Koj Raspberry Pi Siv Wifi

Kev Txuas Hluav Taws Xob rau Koj Raspberry Pi Siv Wifi
Kev Txuas Hluav Taws Xob rau Koj Raspberry Pi Siv Wifi

Thawj lub hom phiaj yog txhawm rau txuas mus rau Raspberry pi (RPi). Piv txwv tias koj twb tau teeb tsa lub operating system Raspberry Pi OS (muaj nyob ntawm no), koj yuav tsum:

  1. Txuas RPi rau Wi-nkaus
  2. Nrhiav nws tus IP Chaw Nyob
  3. Pab kom VNC server ntawm RPi
  4. Rub tawm ntawm koj lub smartphone/ntsiav tshuaj app VNC tus saib.

1) Thawj kauj ruam yog qhov ncaj ncees xav tias koj muaj tus saib xyuas thiab cov keyboard uas koj tuaj yeem txuas rau RPi, qhov no koj tuaj yeem siv tus neeg siv cuam tshuam zoo li koj xav tau ntawm lub khoos phis tawj. Yog tias koj tsis tuaj yeem siv lub ntsuas saib, koj yuav tsum ua raws cov lus qhia rau kev teeb tsa lub taub hau.

2) Rub tawm software "Advanced IP Scanner"; nyem rau ntawm scan thiab nws yuav tso tawm txhua lub cuab yeej ntawm koj lub network hauv zej zog thiab lawv tus IP chaw nyob.

3) Txhawm rau pab VNC server koj yuav tsum qhib lub davhlau ya nyob twg thiab khiav cov lus txib hauv qab no:

sudo raspi-teeb tsa

Tom qab ntawd xauj mus rau Kev Sib Txuas Xaiv, xaiv VNC Server thiab teeb nws rau Enabled. Yog tias koj yog ib tus ntawm cov neeg uas tsis muaj tus saib xyuas koj yuav tsum ua cov kauj ruam no siv SSH kev sib txuas.

4) Thaum kawg, rub lub app VNC Viewer ntawm koj lub xov tooj, coj mus rhaub rau "+" icon, ntaus tus IP chaw nyob ntawm koj RPi, muab lub npe rau nws, thiab ntaus txuas. Cov ntawv pov thawj tsis raug yog:

Tus neeg siv: pi Pass: raspberry

Kauj Ruam 2: Nkag Siab Lub Lole ntawm L293D

Nkag siab Lub Lole ntawm L293D
Nkag siab Lub Lole ntawm L293D

Cov pins ntawm RPi tau tsav los ntawm 3.3 V txoj kev tsheb nqaj hlau thiab muab qhov siab tshaj ntawm 16mA ntawm ib tus pin. Qhov ntawd tsis txaus los siv lub cav. Cov pins tsuas yog ua lub cim taw qhia kom txav txhua lub cav mus rau tom ntej lossis rov qab; raws li qhov kev tawm tswv yim cais cais hu ua H-Choj yuav hloov pauv qhov sib txawv ntawm qhov hluav taws xob siv rau lub cav siv AA roj teeb ua lub zog siv. L293D muaj ob H-txuas txuas yog li koj tuaj yeem txuas ob lub cav rau nws.

Koj yuav tsum xaiv 4 tus pin los ntawm raspberry pi thiab txuas lawv mus rau cov tswj kev nkag pins (7, 2, 10, 15) ntawm L293D.

Kauj Ruam 3: Kev thaiv kab hlau

Thaiv
Thaiv

Txuas RPi thiab L293D rau ntawm daim ntawv tais; muab L293D tso rau hauv nruab nrab ntawm lub khob cij kom txhua tus ntawm nws cov pins nyob ntawm txoj kab ywj pheej. Tom qab ntawd ua kom tiav cov thaiv uas siv cov xov hlau dhia.

Kauj Ruam 4: Qee Qhov Soldering…

Qee qhov Soldering…
Qee qhov Soldering…

Muaj ob peb txoj haujlwm yuav tsum tau ua:

Koj yuav tsum tau xaim 2 dhia xov hlau rau txhua lub cav thiab txuas cov no rau tus lej sib thooj ntawm L293D

Koj yuav tsum txuas lub roj teeb tuav lub zog (5V) thiab xaim hauv av mus rau cov xov tooj sib txuas ntawm USB cable kom koj tuaj yeem txhawb koj RPi siv roj teeb

Kauj ruam 5: Upload Software

Rub tawm Software
Rub tawm Software

Fais fab koj raspberry pi thiab txuas rau nws.

Cov chaw taws teeb nyob deb tau tsim los siv tkinter hauv nab hab sej.

Nruab lub tsev qiv ntawv no khiav cov lus txib

sudo apt-tau nruab python3-tk

Tsim ib daim ntawv tshiab hu ua Remote.py thiab luam-muab tus lej txuas nrog.

Cov nyees khawm sib txuas tau txuas rau 4 lub luag haujlwm hauv qab no uas teeb tsa tus pin rau HIGH lossis LOW hauv kev teeb tsa sib txawv:

def Fw (): GPIO.output (20, GPIO. LOW) GPIO.output (21, GPIO. LOW) GPIO.output (23, GPIO. HIGH) GPIO.output (24, GPIO. HIGH) luam tawm ("Mus rau tom ntej")) def Bk (): GPIO.output (20, GPIO. HIGH) GPIO.output (21, GPIO. HIGH) GPIO.output (23, GPIO. LOW) GPIO.output (24, GPIO. LOW) luam tawm ("Rov Qab ") def Stop (): GPIO.output (20, GPIO. LOW) GPIO.output (21, GPIO. LOW) GPIO.output (23, GPIO. LOW) GPIO.output (24, GPIO. LOW) luam tawm (" Nres ") def Sab laug (): GPIO.output (20, GPIO. LOW) GPIO.output (21, GPIO. LOW) GPIO.output (23, GPIO. HIGH) GPIO.output (24, GPIO. LOW) def Right (): GPIO.output (20, GPIO. LOW) GPIO.output (21, GPIO. LOW) GPIO.output (23, GPIO. LOW) GPIO.output (24, GPIO. HIGH) luam tawm ("Txoj cai")

Thaum npaj txhij los sim qhov kev sim, qhib lub qhov rai davhlau ya nyob twg tshiab, xauj mus rau qhov chaw cov ntaub ntawv thiab khiav cov lus txib:

sej 3 Remote.py

Kauj Ruam 6: Tsim Koj Lub Rover

Tsim Koj Rover
Tsim Koj Rover

Thaum kawg koj tuaj yeem txiav txim siab seb koj lub rover yuav zoo li cas … Kuv muaj qee daim hardboard, pob yas hamster uas zoo li R2D2, lub koob yees duab khoob uas kuv txuas nrog TX RX tus pin (tab sis yog tias koj npaj yuav muab lub koob yees duab tom qab siv lub koob yees duab tseem ceeb sib txuas yog li koj tau txais cov vis dis aus nyob ua ke)

Kuv tsis muaj lub log thib peb yog li kuv yuav tsum tau tsim kho. Kuv 3d-luam qee daim los tuav txhua yam ua ke, Kuv tso lawv txuas yog tias koj xav tau

Pom zoo: