Cov txheej txheem:

Flameless Candle From an Attiny13: 4 Kauj Ruam
Flameless Candle From an Attiny13: 4 Kauj Ruam

Video: Flameless Candle From an Attiny13: 4 Kauj Ruam

Video: Flameless Candle From an Attiny13: 4 Kauj Ruam
Video: Animated LED candle AVR ATtiny13 2024, Kaum ib hlis
Anonim
Flameless Candle Los Ntawm Qhov Attiny13
Flameless Candle Los Ntawm Qhov Attiny13

Kuv yuav tsum tau teeb kuv lub teeb ci, tab sis xyoo no kuv xav tau qee yam zoo dua li tswm ciab ib txwm muaj. Kuv xav flicker, tab sis kuv xav kom tshem ntawm cov nplaim taws. Txhua qhov hluav taws kub yog qhov txaus ntshai, tshwj xeeb tshaj yog nyob ib puag ncig cov menyuam, hlawv cov kua txiv hmab txiv ntoo tsw qab, thiab tswm ciab tas li yuav tsum tau hloov ntau zaus. Yog li kuv tau tshawb nrhiav ib puag ncig rau ib qhov project los theej, txaus txaus kuv tsis pom ib qho kuv nyiam, yog li kuv tsim ib qho rau kuv tus kheej. Kuv thawj qhov pov thawj ntawm lub tswv yim yog nyob ntawm arduino, tab sis qhov ntawd yog tus nqi me ntsis rau tswm ciab yooj yim. Thaum kuv tau ua pov thawj tias nws yuav ua haujlwm, Kuv pom txoj hauv kev kom nws pheej yig. Nov yog qhov kuv tau ua nws, ntawm cov khoom uas kuv muaj ntawm tes. Kuv thawj Circuit thiab kuv thawj zaug qhia.

Kauj Ruam 1: Qhov Chaw

Qhov Chaw
Qhov Chaw

Kuv siv yam kuv muaj ntawm tes. Qhov no tawm los rau. 1) ATtiny13 x12) Liab coj x13) Daj coj x14) 100 ohm resistors x25) 8pin socket x16) hla qhov hloov x17) lub roj teeb rau 2AA roj teeb x18) perf boardresistors yuav sib txawv raws li koj lub leds, koj tuaj yeem tej zaum pom qhov hloov pauv zoo dua li kuv, koj tuaj yeem hla hla lub rooj tsav tsheb thiab xaim nws ua kab tuag yog tias koj xav tau.

Kauj ruam 2: Circuit Court

Qhov Circuit
Qhov Circuit

Kuv lub hauv paus pib, tsuas yog xaim nws zoo li qhov no.

Kauj Ruam 3: Txoj Cai

Nov yog cov cai kuv siv. Kuv tsuas yog nyem lub leds, thiab sim ntxiv qee qhov kev tsis pom zoo rau nws. Cov cai yuav zoo dua siv pwm, thiab txuag lub zog, tab sis kuv tsis paub yuav ua li cas ib qho ntawm qhov ntawd. Kuv thawj qhov tsis yog-arduino Circuit, thiab kuv thawj qhov kev qhia. Cov nyhuv los ntawm ob lub leds yog qhov txaus siab txawm tias kuv tau ua li cas. Hloov pauv qhov ci, xim, thiab flickering. Compile thiab xa cov cai mus rau qhov me me13, thiab koj zoo mus. Feeled dawb los tshaj tawm cov cai zoo dua …#suav nrog int lub ntsiab (tsis muaj dab tsi) {int thePin = 0x0; ntev RandVal; srandom (123); // random noob DDRB = 0x3; // B0-1 teeb tsa rau (;;) {randVal = random (); // xaiv tus pin yog ((randVal % 2) == 0) {thePin = 0x0; } lwm {thePin = 0x1; } randVal = random (); // siab lossis qis yog ((randVal % 2) == 0) {PORTB & = ~ (1 << thePin); // x & = ~ (1 << n); yuam kom nth me ntawm x ua 0. txhua lwm yam khoom nyob ib leeg. } lwm {PORTB | = (1 << thePin); // x | = (1 << n); yuam kom nth me ntawm x kom yog 1. txhua lwm yam khoom nyob ib leeg. }}}

Kauj ruam 4: Yog Nws

Uas Yog Nws
Uas Yog Nws

Koj tuaj yeem xuab zeb lub teeb kom nthuav tawm lub teeb, lossis siv lub teeb ci, koj tuaj yeem siv 2 xim liab/daj coj ib yam thiab tso rau hauv lub hnab ziplock kom nws tsis txhob tag nrho, thiab poob rau hauv taub dag … tam sim flameless tswm ciab, thiab nws yuav nyob ntev li teev teev, thiab koj tsis tas yuav txhawj xeeb txog cov menyuam yaus cuam tshuam nrog nws.

Pom zoo: