Taula de continguts:

Idea de projecte artístic inventiu de bricolatge amb llums i so LED: 3 passos
Idea de projecte artístic inventiu de bricolatge amb llums i so LED: 3 passos

Vídeo: Idea de projecte artístic inventiu de bricolatge amb llums i so LED: 3 passos

Vídeo: Idea de projecte artístic inventiu de bricolatge amb llums i so LED: 3 passos
Vídeo: Акцентная стена, которая навсегда изменила DIY 2024, Juliol
Anonim
Idea de projecte artístic inventiu de bricolatge amb llums i so LED
Idea de projecte artístic inventiu de bricolatge amb llums i so LED

En aquest vídeo us mostraré com fer un projecte artístic únic a casa mitjançant una tira i so LED.

Pas 1: Projecte de vídeo

Image
Image

Tira LED:

Reproductor de MP3:

Sensor d'infrarojos:

Microcontrolador:

Connector:

Adaptador:

Regulador de voltatge -

Altaveu:

Micro SD:

Condensador -

Resistor -

Commutador de commutació:

Eines de soldadura:

Pas 2: Esquema i Gerber

Esquema i Gerber
Esquema i Gerber

Obteniu el tauler:

Pas 3: Codi font

Codi font
Codi font

Codi font:

#incloure

#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; CRGB LED1color [NUM_LEDS_PER_STRIP]; CRGB LED2color [NUM_LEDS_PER_STRIP]; CRGB LED3color [NUM_LEDS_PER_STRIP]; SoftwareSerial mySoftwareSerial (10, 11); // RX, TX DFRobotDFPlayerMini myDFPlayer; void printDetail (tipus uint8_t, valor int); void setup () {mySoftwareSerial.begin (9600); Serial.begin (115200); if (! myDFPlayer.begin (mySoftwareSerial)) {Serial.println (F ("No es pot començar:")); Serial.println (F ("1. Torneu a comprovar la connexió!")); Serial.println (F ("2. Introduïu la targeta SD!")); mentre que (cert); } pinMode (IR1pin, INPUT); pinMode (IR2pin, INPUT); pinMode (IR3pin, INPUT); myDFPlayer.volume (20); myDFPlayer. EQ (DFPLAYER_EQ_CLASSIC); myDFPlayer.outputDevice (DFPLAYER_DEVICE_SD); FastLED.addLeds (LED1color, NUM_LEDS_PER_STRIP); FastLED.addLeds (LED2color, NUM_LEDS_PER_STRIP); FastLED.addLeds (LED3color, NUM_LEDS_PER_STRIP); FastLED.setBrightness (BRIGHTNESS); } bucle buit () {if (digitalRead (IR1pin) == BAIX) {LED1show (); } if (digitalRead (IR2pin) == BAIX) {LED2show (); } if (digitalRead (IR3pin) == BAIX) {LED3show (); }} void LED1show () {myDFPlayer.play (1); per a (int i = 0; i = 0; i--) {LED1color = CRGB:: Verd; FastLED.show (); LED1color = CRGB:: Negre; retard (100); } myDFPlayer.pause (); } void LED2show () {myDFPlayer.play (2); per a (int i = 0; i = 0; i--) {LED2color = CRGB:: Verd; FastLED.show (); LED2color = CRGB:: Negre; retard (100); } myDFPlayer.pause (); } void LED3show () {myDFPlayer.play (3); per a (int i = 0; i = 0; i--) {LED3color = CRGB:: Verd; FastLED.show (); LED3color = CRGB:: Negre; retard (100); } myDFPlayer.pause (); }

Recomanat: