Kazalo:

Ideja projekta DIY Inventive ART z LED lučmi in zvokom: 3 koraki
Ideja projekta DIY Inventive ART z LED lučmi in zvokom: 3 koraki

Video: Ideja projekta DIY Inventive ART z LED lučmi in zvokom: 3 koraki

Video: Ideja projekta DIY Inventive ART z LED lučmi in zvokom: 3 koraki
Video: REVAN - THE COMPLETE STORY 2024, November
Anonim
DIY Inventive ART Project Idea z LED lučmi in zvokom
DIY Inventive ART Project Idea z LED lučmi in zvokom

V tem videu vam bom pokazal, kako narediti edinstven umetniški projekt doma z LED trakom in zvokom.

Korak: Video o projektu

Image
Image

LED trak -

MP3 predvajalnik -

Infrardeči senzor -

Mikrokrmilnik -

Priključek -

Adapter -

Regulator napetosti -

Zvočnik -

Micro SD -

Kondenzator -

Upor -

Preklopno stikalo -

Spajkalna orodja -

2. korak: Shema in Gerber

Shematski in Gerber
Shematski in Gerber

Pridobite tablo -

3. korak: izvorna koda

Izvorna koda
Izvorna koda

Izvorna koda:

#vključi

#include "SoftwareSerial.h" #include "DFRobotDFPlayerMini.h" #define NUM_LEDS_PER_STRIP 70 #define BRIGHTNESS 200 #define LED1pin 5 #define LED2pin 6 #define LED3pin 7 const int IR1pin = A0; const int IR2pin = A1; const int IR3pin = A2; Barva LED LED CRGB [NUM_LEDS_PER_STRIP]; CRGB LED2 barva [NUM_LEDS_PER_STRIP]; CRGB LED3 barva [NUM_LEDS_PER_STRIP]; SoftwareSerial mySoftwareSerial (10, 11); // RX, TX DFRobotDFPlayerMini mojDFPlayer; void printDetail (vrsta uint8_t, vrednost int); void setup () {mySoftwareSerial.begin (9600); Serial.begin (115200); if (! myDFPlayer.begin (mySoftwareSerial)) {Serial.println (F ("Ne morem začeti:")); Serial.println (F ("1. Prosimo, ponovno preverite povezavo!")); Serial.println (F ("2. Prosimo, vstavite kartico SD!")); medtem ko (res); } 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 barva, NUM_LEDS_PER_STRIP); FastLED.addLeds (LED2 barva, NUM_LEDS_PER_STRIP); FastLED.addLeds (LED3 barva, NUM_LEDS_PER_STRIP); FastLED.setBrightness (SVETLOST); } void loop () {if (digitalRead (IR1pin) == LOW) {LED1show (); } if (digitalRead (IR2pin) == LOW) {LED2show (); } if (digitalRead (IR3pin) == LOW) {LED3show (); }} void LED1show () {myDFPlayer.play (1); za (int i = 0; i = 0; i--) {LED1color = CRGB:: Zelena; FastLED.show (); LED1color = CRGB:: Črna; zamuda (100); } myDFPlayer.pause (); } void LED2show () {myDFPlayer.play (2); za (int i = 0; i = 0; i--) {LED2color = CRGB:: Zelena; FastLED.show (); LED2color = CRGB:: Črna; zamuda (100); } myDFPlayer.pause (); } void LED3show () {myDFPlayer.play (3); za (int i = 0; i = 0; i--) {LED3color = CRGB:: Zelena; FastLED.show (); LED3color = CRGB:: Črna; zamuda (100); } myDFPlayer.pause (); }

Priporočena: