Cov txheej txheem:

DIY PROJECT: 3 Kauj Ruam
DIY PROJECT: 3 Kauj Ruam

Video: DIY PROJECT: 3 Kauj Ruam

Video: DIY PROJECT: 3 Kauj Ruam
Video: How to make DNA 3d working model DIY | How to build a DNA model rotate at 360° for science projects 2024, Kaum ib hlis
Anonim
DIY PROJECT
DIY PROJECT

INSTRUCTABLE no yuav dhau los ntawm kuv ENTIRE DIY PROJECT thiab txhua kauj ruam ntawm txoj kev taug thiab txheej txheem. Kuv tseem yuav hais qhia yam twg ntawm cov peev txheej thiab khoom siv uas koj yuav xav tau los tsim koj li haujlwm DIY (Qhov ntawd zoo ib yam li kuv li). Kuv DIY Project yog qhov pib ua si yooj yim uas tuaj yeem ua si nrog ob tus neeg ua si. Nws ib txwm nug ib lo lus nug thiab nws tos rau ib qho ntawm LDR (Lub Teeb Pom Kev Tiv Thaiv) kom tau txais kev pab. LED yuav qhib, thiab qhov no yuav tso cai rau tus neeg uas ua ntawv 1 lossis tus neeg ua si 2 los teb cov lus nug tseeb lossis tsis tseeb. Tom qab nws dhau los ntawm txhua cov lus nug, qhov kev ua si tau ua tiav.

Khoom siv

Cov khoom siv xav tau yog:

BreadBoard

Raspberry Ncuav Qab Zib

Duab los qhia

Daim kab xev

Cov cim

Txiv neej Txiv neej Hlau

2 LED (Txawv Xim)

2 Resistors (330 K Ohm)

2 LDR Sensors

2 10 V Capacitors

2 Caps los npog ib yam.

Kauj Ruam 1: Thawj Kauj Ruam (Muab Ua Ke Hauv Circuit)

Thawj Kauj Ruam (Muab Ua Ke Hauv Circuit)
Thawj Kauj Ruam (Muab Ua Ke Hauv Circuit)

Wb mus dhau tus txheej txheem ntawm kev tsim lub Circuit Court ua ke

Ua ntej peb ua qhov no sai dua los tshuaj xyuas cov npe khoom kom pom dab tsi koj xav tau los teeb tsa qhov nyuaj / yooj yim Circuit Court

Tam sim no koj muaj txhua yam cia pib

Ua ntej tshaj plaws muab koj ob LDRS thiab Capacitors tso ua ke thiab xyuas kom lawv ua haujlwm nrog tus lej

Txuas LDR mus rau qhov tsis zoo ntawm Capacitor (Rau ob qho tib si). Tom qab ua qhov no, txuas lwm ceg ntawm ob LDRS rau lub zog (5 Volts). Tom qab qhov no txuas tus ceg ntawm LDR txuas nrog Capacitor rau GPIO Pin (Rau kuv qhov no, nws yog GPIO 5 Player 2 thiab 16 Player 1).

Tom qab ntawd txuas lwm ceg ntawm Capacitor rau hauv av (Ob Qhov Capacitors).

Nov yog qhov koj teeb tsa LDR, tam sim no txuas ob LEDS thiab xyuas kom lawv ua haujlwm nrog cov lej ib yam.

Txuas Tus Cuam Tshuam Tsis Zoo ntawm LED mus rau hauv av (Ob leeg). Tom qab qhov no, txuas qhov zoo ntawm ob qho tib si LEDS nrog 330 Ohm Resistor, thiab tom qab ntawd txuas qhov txuas mus rau GPIO Pin (Hauv qhov no GPIO Pin 19 Player 2 thiab Pin 12 Player 1)

Tom qab qhov no koj lub Circuit yuav tsum zoo ib yam li daim duab kuv muaj ntawm no (Tsis quav ntsej lub Circuit Court ib sab nws)

Kauj Ruam 2: Kauj Ruam Ob (Txoj Cai)

Kauj Ruam Ob (Txoj Cai)
Kauj Ruam Ob (Txoj Cai)
Kauj Ruam Ob (Txoj Cai)
Kauj Ruam Ob (Txoj Cai)
Kauj Ruam Ob (Txoj Cai)
Kauj Ruam Ob (Txoj Cai)

Ua Txoj Cai yuav yog qhov nyuaj dua ntawm DIY Project no, yog li ua raws nrog ua tib zoo

Ua ntej tshaj plaws sau txhua qhov ntshuam LED, LightSensor thiab Pw tsaug zog:

los ntawm gpiozero ntshuam LED, LightSensor

los ntawm lub sijhawm ntshuam pw

Tom qab ntawv ntshuam koj cov kev hloov pauv

LDR1 = LightSensor (16, 5, 1)

LDR2 = LightSensor (5, 5, 1)

LED1 = LED (12)

LED2 = LED (19)

Tam sim no Ua Koj Thawj Cov Lus Nug los ua Cov Lus Nug tshwm thiab muaj Player 1 lossis 2, npog lawv lub sensor kom tig lawv lub LED, qhov no yuav zoo li no:

luam tawm ("Ram thiab Rom yog tib yam")

thaum Muaj Tseeb:

yog ldr2.value == (0):

print ( Player 1 Teb:)

coj2.on ():

teb = tswv yim ("Muaj tseeb lossis tsis tseeb")

yog teb == "F" (Los yog T nyob ntawm lo lus nug)

print ( Player 2 koj hais yog lawm!)

p1 () (Qhov no yuav yog qhov tseem ceeb tom qab)

lwm tus:

print ("Thov txim, tsis raug")

p1 ()

Ua tib yam nrog Player 2 (Tsuas yog yuav tsum hloov 1 rau 2)

thaum muaj tseeb: yog ldr1.value == (0): print ("Player 1 Answer:) led1.on (): answer = input (" True or False ") if answer ==" F "(Los yog T nyob ntawm lo lus nug) luam tawm ("Player 1 koj hais raug lawm!) p1 () (Qhov no yuav yog qhov tseem ceeb tom qab) lwm qhov: luam tawm (" Thov txim, tsis raug ") p1 ()

P1 () txhais li cas yog tias, thaum ua tib txoj cai no rau lwm cov lus nug, cov lus nug yuav raug txhais (qhov no txhais tau tias tom qab teb cov lus nug nws yuav mus rau lo lus nug ntawd. Yog li piv txwv:

Cov Lus Nug Ntxiv

def p1 ()

print ('\ n') (Qhov no muab qhov chaw nruab nrab ntawm cov lus nug)

luam tawm ("2. Txoj hauv kev zoo tshaj kom txias lub computer yog muab tso rau sab nraud")

Tom qab ntawd koj yuav tib txoj cai nrog LDR (Uas yog saum toj no)

Tom qab ntawd koj yuav hloov p2 () hloov p1 (), mus rau cov lus nug tom ntej (Tau kawg siv cov cai txhais hauv Python).

Thiab qhov ntawd yog nws. Ntawd yog Coding ib feem ntawm Circuit kom txhua yam ua haujlwm.

Kauj Ruam 3: Muab Nws Tag Nrho Ua Ke (Nrog Kev Xeem thiab Kev Tso Tawm)

Tom qab kev ua haujlwm hauv Circuit Court thiab Code tau ua tiav, tso tawm thiab sim koj cov cai thiab pom tias nws ua haujlwm, yog tias nws tsis yog li nws yuav yog ntau yam ntawm cov teeb meem no:

Faulty Breadboard lossis Cov Hluav Taws Xob Tsis Zoo

LED tawg lossis LDR tsis ua haujlwm zoo

Ib yam dab tsi tsis ncaj ncees lawm nrog koj cov cai lossis cov Circuitry

Tom qab ua qhov kev sim thiab xws li, teeb tsa koj cov cai thiab ua kom yooj yim li sai tau.

Tam sim no cia peb tham txog muab tso ua ke

Tau txais koj cov khoom siv ntawm Cardboard thiab Daim Kab Xev.

1. Txiav daim Cardboard kom txaus rau txhua sab ntawm txoj kev breadbroad, thiab tom qab ntawd txiav ib sqaure rau qhov twg lub teeb tiv thaiv yog li koj tuaj yeem tso koj cov khoom hla nws (Rau ob sab, thiab kos lub xwmfab nrog tus cim)

2. Txiav Cardboard rau qhov kawg ntawm Breadboard kom muaj lub thawv tiav

3. Tam sim no koj tuaj yeem khiav koj cov game thiab ua si.

Pom zoo: