Cov txheej txheem:

Attiny85 Tus Nrhiav Qhov Chaw Nyob: 4 Kauj Ruam (nrog Duab)
Attiny85 Tus Nrhiav Qhov Chaw Nyob: 4 Kauj Ruam (nrog Duab)

Video: Attiny85 Tus Nrhiav Qhov Chaw Nyob: 4 Kauj Ruam (nrog Duab)

Video: Attiny85 Tus Nrhiav Qhov Chaw Nyob: 4 Kauj Ruam (nrog Duab)
Video: 3 Yam Ua Rau Koj Yog Tus Neeg Vam Meej 2024, Kaum ib hlis
Anonim
Image
Image
Attiny85 Nrug Nrug Nrhav
Attiny85 Nrug Nrug Nrhav
Attiny85 Nrug Nrug Nrhav Nrhiav
Attiny85 Nrug Nrug Nrhav Nrhiav

Ua ntej kuv ua cov lus qhia no kuv nyuam qhuav tau txais qee qhov Attinys tshiab (Attinies?) Thiab xav ua qee yam nrog lawv. Ntawd yog thaum kuv pom kuv tus ultrasonic ntau finder ib leeg tsis siv. Qhov ntsuas qhov ntsuas qhov ntsuas qhov tsis txaus ntseeg no muab qhov nrug deb dhau los ntawm cov kab hluav taws xob LEDs thiab tuaj yeem hloov pauv los ntawm CM rau IN los ntawm kev tuav lub pob kom ntev txaus.

Kauj Ruam 1: Sau Cov Khoom

Thov txim, feem ntau ntawm cov txuas yog rau cov khoom lag luam tab sis lawv pheej yig thiab yog qhov kuv tau siv.

  • Attiny85/45 - Tus nqi ntawm Ebay tuaj yeem pom nyob ib puag ncig $ 2.00 tab sis cov npe xaus sai sai no yog ntawm Amazon
  • 8 Pin Qhov (Socket)
  • Swb hloov
  • Khawm
  • Ultrasonic Distance Finder
  • Leds x 3 (Txhua xim)
  • Resistors uas mus nrog cov xim xaiv rau 5v https://led.linear1.org/1led.wiz (muaj txiaj ntsig resistor lub laij lej)
  • Perfboard - $ 6.99 rau 5. Kuj saib ntawm Ebay.
  • Cuaj lub roj teeb + tus tuav
  • 5v qhov ntsuas hluav taws xob

Kauj Ruam 2: Ua Circuit Court

Ua Circuit Court
Ua Circuit Court
Ua Circuit Court
Ua Circuit Court
Ua Circuit Court
Ua Circuit Court

Yog tias koj xav tau koj tuaj yeem sim qhov no ntawm lub khob cij kom paub tseeb tias txhua yam tau ua tiav, lossis koj tuaj yeem mus ncaj nraim mus rau lub rooj ntoo (lossis tsim koj tus kheej PCB).

tus naj npawb chaw nres nkoj (tus lej tus lej)

  • Ultrasonic ncho + Trig pin >>> 2 (7)
  • Khawm ------------------------- >>> 1 (6)
  • 50s LED ---------------------- >>> 0 (5)
  • 10s LED --------------------- >> 4 (3)
  • 1s LED ------------------------ >>> 3 (2)

Xav tias dawb los hloov cov no ib qho twg uas yooj yim ua. Kuv teeb nws li no vim nws saib qhov zoo tshaj plaws ntawm Fritzing:)

Kauj ruam 3: Program Attiny

Program qhov Attiny
Program qhov Attiny

Raws li koj tej zaum paub cov kauj ruam ntxiv xav tau txhawm rau txhawm rau program Attiny. Yog tias koj paub yuav ua li cas rau phiaj xwm txuas ntxiv ntawm koj txoj kev! Yog tias koj tsis ua, ntawm no yog qhov txuas lossis cov lus qhia!

Tsis tas li, Ua kom ntseeg tau txhawm rau rub tawm New Ping tsev qiv ntawv raws li qhov kuv tuaj yeem muaj tus ncha thiab ua rau tib tus pin. Yog tias koj tsis paub yuav ntxiv lub tsev qiv ntawv li cas, rub tawm.zip los ntawm qhov txuas ces mus rau Sketch> suav nrog Lub Tsev Qiv Ntawv> Ntxiv.zip Library> Rub Tawm> NewPing*.zip

*Thov tsis txhob hais tias koj tau txais qhov yuam kev thaum suav ua ntej yam tsis tau ntxiv thawj lub tsev qiv ntawv!*

Thiab ntawm no yog cov cai.

Kauj ruam 4: Siv Nws

Yeej tam sim no nws tsuas yog taw tes thiab tua (zoo, nias).

Txhawm rau muab qhov nrug muaj peb LEDs. Ib lub ntsiab lus 50, 10, thiab 1 feem. Piv txwv li, yog tias qhov deb yog 67 ces 50 LED yuav nyem ib zaug, 10 yuav nyem ib zaug thiab 1 yuav nyem xya zaug. Txhua qhov ntxiv mus txog 67. (50 + 10 + 7 = 67).

Txhawm rau hloov nws los ntawm CM rau IN lossis hloov pauv tuav lub pob kom dhau ob vib nas this. Nyob ntawm seb nws yog tam sim no ntawm (Nws lub neej yog CM) txhua lub LEDs yuav nyem los qhia qhov nws tau teeb tsa.

Lub teeb pom kev ntawm qhov ntawd tawm == CM rau INFlashing teeb ---------- == IN rau CM

Yog tias koj muaj lus nug thov hu dawb!

Pom zoo: