Cov txheej txheem:

Tiag tiag Flickering Flame Effect Nrog Arduino thiab LED's: 4 Cov Kauj Ruam
Tiag tiag Flickering Flame Effect Nrog Arduino thiab LED's: 4 Cov Kauj Ruam

Video: Tiag tiag Flickering Flame Effect Nrog Arduino thiab LED's: 4 Cov Kauj Ruam

Video: Tiag tiag Flickering Flame Effect Nrog Arduino thiab LED's: 4 Cov Kauj Ruam
Video: Arduino based LED Candle 2024, Kaum ib hlis
Anonim
Tiag tiag Flickering nplaim nyhuv nrog Arduino thiab LED's
Tiag tiag Flickering nplaim nyhuv nrog Arduino thiab LED's
Tiag tiag Flickering nplaim nyhuv nrog Arduino thiab LED's
Tiag tiag Flickering nplaim nyhuv nrog Arduino thiab LED's
Tiag tiag Flickering nplaim nyhuv nrog Arduino thiab LED's
Tiag tiag Flickering nplaim nyhuv nrog Arduino thiab LED's

Hauv qhov haujlwm no peb yuav siv 3 LED's thiab Arduino los tsim qhov hluav taws kub tiag tiag uas tuaj yeem siv tau hauv diorama, qauv kev tsheb nqaj hlau lossis lub qhov cub cuav hauv koj lub tsev lossis tso ib sab hauv lub khob khov iav lossis raj thiab tsis muaj leej twg yuav paub. nws tsis yog lub tswm ciab sab hauv no yog qhov haujlwm yooj yim heev uas haum rau cov pib tshiab.

Kauj Ruam 1: Kauj Ruam 1 - Txhim Kho Cov LED

Kauj Ruam 1 - Txhim Kho Cov LED
Kauj Ruam 1 - Txhim Kho Cov LED

Siv 3 LEDs. Siv 2 x Diffused Yellow thiab 1 x Diffused RED. Koj tuaj yeem nce tus lej ntawm LED yog tias koj xav tau cov duab loj dua lossis ci dua. Xav txog kev siv cov transistors yog tias koj qhov amperage yuav hla qhov uas tuaj yeem muab tau los ntawm Arduino. Use resistors uas haum rau koj hom LED tshwj xeeb.

Kauj ruam 2: Nkag mus rau Code

Sau tus Code
Sau tus Code

Nkag mus rau tus lej no: // LED Hluav Taws Xob Effectint ledPin1 = 10; int ledPin2 = 9; int ledPin3 = 11; tsis muaj teeb meem teeb tsa () {pinMode (ledPin1, OUTPUT); pinMode (ledPin2, OUTPUT); pinMode (ledPin3, OUTPUT);} void loop () {analogWrite (ledPin1, random (120) +135); analogWrite (ledPin2, random (120) +135); analogWrite (ledPin3, random (120) +135); ncua (random (100));}

Kauj ruam 3: Upload thiab Khiav

Upload thiab khiav
Upload thiab khiav

Rub cov cai rau Arduino thiab khiav nws. Tam sim no koj yuav muaj qhov nplaim hluav taws zoo tiag tiag los ntawm cov LED. Thaws lub teeb tawm ntawm daim npav dawb lossis daim iav kom ua tiav cov txiaj ntsig tag nrho.

Kauj ruam 4: Yees duab ntawm Cov nyhuv

Yees duab ntawm Cov nyhuv
Yees duab ntawm Cov nyhuv

Yees duab ntawm cov nyhuv. Cov xim thiab cov nyhuv tsis pom zoo heev hauv cov vis dis aus. Hauv lub neej tiag nws yog cov nplaim hluav taws zoo heev. Muab nws sim.

Pom zoo: