Mundarija:

LED chiroqlar va tovushli DIY ixtirochilik ART loyihasi g'oyasi: 3 qadam
LED chiroqlar va tovushli DIY ixtirochilik ART loyihasi g'oyasi: 3 qadam

Video: LED chiroqlar va tovushli DIY ixtirochilik ART loyihasi g'oyasi: 3 qadam

Video: LED chiroqlar va tovushli DIY ixtirochilik ART loyihasi g'oyasi: 3 qadam
Video: 16 yoshda 50 ta ixtiro 2024, Noyabr
Anonim
LED chiroqlar va tovushli DIY ixtirochilik ART loyihasi g'oyasi
LED chiroqlar va tovushli DIY ixtirochilik ART loyihasi g'oyasi

Bu videoda men sizga LED tasmasi va tovush yordamida uyda noyob san'at loyihasini qanday qilishni ko'rsataman.

1 -qadam: Video loyiha

Image
Image

LED chizig'i -

MP3 pleer -

Infraqizil sensor -

Mikrokontroller -

Ulagich -

Adapter -

Voltaj regulyatori -

Karnay -

Micro SD -

Kondensator -

Qarshilik -

Kalitni almashtirish -

Lehimlash asboblari -

2 -qadam: Sxematik va Gerber

Sxematik va Gerber
Sxematik va Gerber

Kengashni oling -

3 -qadam: Manba kodi

Manba kodi
Manba kodi

Manba kodi:

#qo'shing

#include "SoftwareSerial.h" #include "DFRobotDFPlayerMini.h" #NUM_LEDS_PER_STRIP 70 #devetine BRIGHTNESS 200 #define LED1pin 5 #define LED2pin 6 #de3ine LED3pin 7 const int IR1pin = A0; const int IR2pin = A1; const int IR3pin = A2; CRGB LED1 rang [NUM_LEDS_PER_STRIP]; CRGB LED2 rang [NUM_LEDS_PER_STRIP]; CRGB LED3 rang [NUM_LEDS_PER_STRIP]; SoftwareSerial mySoftwareSerial (10, 11); // RX, TX DFRobotDFPlayerMini myDFPlayer; void printDetail (uint8_t turi, int qiymati); void setup () {mySoftwareSerial.begin (9600); Serial.begin (115200); if (! myDFPlayer.begin (mySoftwareSerial)) {Serial.println (F ("Boshlash mumkin emas:")); Serial.println (F ("1. Iltimos, ulanishni qayta tekshiring!")); Serial.println (F ("2. Iltimos, SD -kartani joylashtiring!"))); while (rost); } pinMode (IR1pin, INPUT); pinMode (IR2pin, INPUT); pinMode (IR3pin, INPUT); myDFPlayer.volume (20); myDFPlayer. EQ (DFPLAYER_EQ_CLASSIC); myDFPlayer.outputDevice (DFPLAYER_DEVICE_SD); FastLED.addLeds (LED1 rang, NUM_LEDS_PER_STRIP); FastLED.addLeds (LED2color, NUM_LEDS_PER_STRIP); FastLED.addLeds (LED3color, NUM_LEDS_PER_STRIP); FastLED.setBrightness (Yorqinligi); } void loop () {if (digitalRead (IR1pin) == LOW) {LED1show (); } if (digitalRead (IR2pin) == LOW) {LED2show (); } if (digitalRead (IR3pin) == LOW) {LED3show (); }} bo'sh LED1show () {myDFPlayer.play (1); uchun (int i = 0; i = 0; i--) {LED1color = CRGB:: Yashil; FastLED.show (); LED1color = CRGB:: Qora; kechikish (100); } myDFPlayer.pause (); } bo'sh LED2show () {myDFPlayer.play (2); uchun (int i = 0; i = 0; i--) {LED2color = CRGB:: Yashil; FastLED.show (); LED2color = CRGB:: Qora; kechikish (100); } myDFPlayer.pause (); } bo'sh LED3show () {myDFPlayer.play (3); uchun (int i = 0; i = 0; i--) {LED3color = CRGB:: Yashil; FastLED.show (); LED3color = CRGB:: Qora; kechikish (100); } myDFPlayer.pause (); }

Tavsiya: