Cov txheej txheem:
- Kauj ruam 1: GPIO Extension
- Kauj Ruam 2: Ultrasonic Sensor
- Kauj ruam 3: LED thiab Resistors
- Kauj ruam 4: Hauv av
- Kauj ruam 5: Nyees khawm
- Kauj ruam 6: Code
Video: Kev Tiv Thaiv Kev Sib tsoo- Txhawb los ntawm Pi: 6 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Cov Lus Qhia no yuav qhia koj ib qib zuj zus qhia rau kev tsim kho Kev Tiv Thaiv Kev Sib tsoo. Txhawm rau pib ib qho yuav tsum tau txais cov npe khoom hauv qab no:
Raspberry PI 3 (nrog lub zog thiab Ethernet chords), 1 GPIO Extension Board thiab Ribbon Cable (GPIO), 1 Loj Breadboard nrog daim duab, 2 lub me me breadboards nrog daim duab, 14 jumper cables, 3 220 Ohms resistor, 1 RGB LED, 3 khawm hloov, 1HB-SR04 Ultrasonic sensor
Kauj ruam 1: GPIO Extension
Txuas GPIO lub rooj tsav xwm txuas mus rau lub rooj noj mov loj. GPIO yuav tsum tig ntsej muag ib yam li lub khob cij. Muab sab laug ntawm GPIO mus rau lub chaw tso khoom noj khoom haus D1-D20 siv daim duab qhia. Sab xis ces yuav txuas rau H1-H20. Txuas cov hlua txuas rau ob qho Raspberry Pi 3 thiab GPIO lub rooj tsav xwm txuas ntxiv. Tag nrho cov khoom siv tam sim no yuav raug xa mus ua GPIO board (GPIO)
Kauj Ruam 2: Ultrasonic Sensor
Siv lwm lub khob cij me me, txuas rau HR-SR04 lub ntsuas hluav taws xob ultrasonic mus rau qhov chaw me me breadboard A2-5 siv daim duab qhia. Txuas lub jumper cable mus rau lub khob cij me me (BB) E2, ntxig rau lwm qhov kawg hauv GPIO txuas lub rooj tsav xwm chaw nres nkoj J1. Ib yam nkaus, txuas peb tus neeg dhia ntxiv hauv cov qauv hauv qab no. (BB E3, GPIO B17) (BB E4, GPIO B18) (BB E5, GPIO B20)
Kauj ruam 3: LED thiab Resistors
Ntawm tib lub khob cij me me uas tau siv hauv kev qhia yav dhau los, txuas peb 220 ohm resistors hauv cov qauv hauv qab no. (E10, H10) (E12, H12) (E14, H14) Tom qab ntawd txuas lub jumper los ntawm tib lub khob cij E13 rau hauv av tsheb ciav hlau ntawm GPIO board. Txuas plaub kab ntawm LED mus rau qhov chaw me me ntawm lub rooj noj mov (B13) (D14) (D12) (D10). Tom qab ntawd txuas peb tus neeg dhia los ntawm lub khob cij me me mus rau pawg thawj coj saib xyuas GPIO hauv txoj haujlwm tau muab. (BB J10, GPIO J9) (BB J12, GPIO J8) (BB J14, GPIO J6). Daim ntawv qhia zaub mov no tau ua tiav.
Kauj ruam 4: Hauv av
Siv lwm lub jumper los txuas GPIO board J7 rau hauv av tsheb ciav hlau.
Kauj ruam 5: Nyees khawm
Siv lub khob cij thib ob tso rau sab saum toj ntawm lub pob hloov ntawm chaw nres nkoj E1 thiab D1, tso lwm qhov ntawm E5 thiab D5, thiab thib peb ntawm E9 thiab D9. Txuas peb tus neeg dhia los ntawm txoj kab hluav taws xob zoo ntawm GPIO pawg thawj coj mus rau cov chaw nres nkoj hauv qab no (D3) (D7) (D11). Siv peb txoj hlua txuas txuas txuas ntxiv, txuas lub khob cij rau GPIO lub rooj sib tham txuas ntxiv hauv cov tsev hauv qab no: (BB D1, GPIO J16) (BB D5, GPIO J18) (BB D9, GPIO J20). Thaum kawg, siv cov hlua txuas kawg, txuas GPIO A1 mus rau txoj kev tsheb nqaj hlau zoo. Kev teeb tsa lub cev tam sim no tiav.
Kauj ruam 6: Code
Txuas Ethernet cable thiab fais fab cable rau Pi thiab rau hauv lawv txoj haujlwm. Qhib MATLAB thiab khiav cov ntawv hauv qab no los pib lub micro-controller:
rpi = raspi ('169.254.0.2', 'pi', 'raspberry');
Tom qab ntawd luam thiab muab cov hauv qab no tso rau hauv tsab ntawv tshiab, hu ua Ping, kom ua haujlwm tiv thaiv kev sib tsoo:
muaj nuj nqi dist = ping () trig = 19; ncho = 13; xeem = 21; configurePin (rpi, trig, 'DigitalOutput'); configurePin (rpi, ncha, 'DigitalInput'); configurePin (rpi, xeem, 'DigitalInput');
disp ("Kev Txheeb Ze Nyob Hauv Qhov Kev Kawm");
thaum muaj tseeb writeDigitalPin (rpi, trig, 0); disp ("Cia lub sensor tsaws"); ncua (2);
writeDigitalPin (rpi, trig, 1); ncua (0.002); writeDigitalPin (rpi, trig, 0);
thaum nyeemDigitalPin (rpi, ncha) == 0 tic kawg
thaum nyeemDigitalPin (rpi, ncha) == 1 T = toc; kawg
pulse_duration = T; nrug = mem tes_duration * 17150;
qhib = "Nyob deb ="; ze = "cm"; hlua = [qhib, nrug, kaw]; disp (hlua); deb = nrug; kawg kawg
Hauv tsab ntawv tshiab, khiav cov cai hauv qab no hu ua xwm txheej:
configurePin (rpi, 21, 'DigitalInput'); teeb tsa Pin (rpi, 16, 'DigitalInput'); configurePin (rpi, 12, 'DigitalInput');
xwm txheej = 2; d = 10; Qhov xwm txheej: 0-Liab/Nres 1-Xiav/qeeb 2-Ntsuab/Mus khiav = muaj tseeb; thaum khiav %d = ping (); yog readDigitalPin (rpi, 21) == 1 xwm txheej = 0; elseif nyeemDigitalPin (rpi, 16) == 1 xwm txheej = 1; elseif nyeemDigitalPin (rpi, 12) == 1 xwm txheej = 2; lwm d
Pom zoo:
Arduino Counter Siv TM1637 LED Zaub & Kev Tiv Thaiv Kev Tiv Thaiv: 7 Cov Kauj Ruam
Arduino Counter Siv TM1637 LED Zaub & Kev Tiv Thaiv Kev Tiv Thaiv: Hauv qhov kev qhia no peb yuav kawm paub yuav ua li cas tus lej lej yooj yim siv LED Zaub TM1637 thiab teeb meem zam kev ntsuas thiab Visuino. Saib cov vis dis aus
YUAV TSUM HNOV TSHUAJ TIV THAIV TSHUAJ TIV THAIV TSHUAJ TIV THAIV LAMP: 8 Kauj Ruam
YUAV UA LI CAS YUAV TSHUAJ TSEEB TSHUAB PLASTICS RAU DESKTOP LAMP: hauv cov lus qhia no kuv yuav qhia koj yuav ua li cas thiaj ua rau koj tus kheej lub teeb pom kev zoo siv cov khoob yas khoob khoob
Pib Tus Kheej Tsav Tsheb Tsav Tsheb Nrog Kev Tiv Thaiv Kev Sib tsoo: 7 Kauj Ruam
Pib Tus Kheej Tsav Tsheb Tsav Tsheb Nrog Kev Tiv Thaiv Kev Sib tsoo: Nyob Zoo! Zoo siab txais tos rau kuv tus pib-phooj ywg Qhia paub yuav ua li cas thiaj ua rau koj tus kheej tsav tsheb lub tsheb uas tsis muaj kev sib tsoo thiab GPS Kev Nkoj. Saum toj no yog cov vis dis aus YouTube qhia txog tus neeg hlau. Nws yog tus qauv los qhia txog yuav ua li cas thiaj muaj kev ywj pheej tiag tiag
Kev Tiv Thaiv Kev Tiv Thaiv Tsheb: 5 Kauj Ruam
Kev Tiv Thaiv Kev Tiv Thaiv Tsheb: Lub tsheb lub kaum ntse ntse yog lub tsheb kom tsis txhob muaj lub ntsej muag ntse, lub cev ntawm lub tsheb siv cov txheej txheem txhuas, kev tswj hwm tseem ceeb siv Arduino/Nano microcontroller, pawg thawj coj saib xyuas lub cev tsim lub plug-in tsim (nws yooj yim dua txuas sab nraud sensor ntawm microcontroller
Kom Tau Tshuaj Tiv Thaiv lossis Tsis? Txoj Haujlwm Saib Xyuas Kev Tiv Thaiv Kab Mob Los Ntawm Kab Mob Simulation: 15 Kauj Ruam
Kom Tau Tshuaj Tiv Thaiv lossis Tsis? Txoj Haujlwm Saib Xyuas Kev Tiv Thaiv Kab Mob Los Ntawm Kab Mob Simulation: Txheej txheem cej luam ntawm Txoj Haujlwm: Peb txoj haujlwm tshawb nrhiav pab pawg tiv thaiv kab mob thiab vam tias yuav txhawb cov tib neeg kom txhaj tshuaj tiv thaiv kom txo tus kab mob hauv peb cov zej zog. Peb txoj haujlwm sim ua li cas tus kab mob kis rau cov pejxeem nrog feem pua sib txawv ntawm kev txhaj tshuaj tiv thaiv kab mob