Talaan ng mga Nilalaman:

DIY Inventive ART Project Idea With LED Lights and Sound: 3 Hakbang
DIY Inventive ART Project Idea With LED Lights and Sound: 3 Hakbang

Video: DIY Inventive ART Project Idea With LED Lights and Sound: 3 Hakbang

Video: DIY Inventive ART Project Idea With LED Lights and Sound: 3 Hakbang
Video: Wow !!! 3 Genius DIY LED Projects & IDEAS 2024, Nobyembre
Anonim
DIY Inventive ART Project Idea With LED Lights and Sound
DIY Inventive ART Project Idea With LED Lights and Sound

Sa video na ito ipapakita ko sa iyo kung paano gumawa ng natatanging proyekto sa sining sa bahay gamit ang LED strip at tunog.

Hakbang 1: Video ng Proyekto

Image
Image

LED Strip -

MP3 Player -

Infrared Sensor -

Microcontroller -

Connector -

Adapter -

Voltage Regulator -

Tagapagsalita -

Micro SD -

Capacitor -

Resistor -

Toggle Switch -

Mga Tool sa Paghihinang -

Hakbang 2: Schematic at Gerber

Schematic at Gerber
Schematic at Gerber

Kunin ang Lupon -

Hakbang 3: Source Code

Source Code
Source Code

Source Code:

# isama

# isama ang "SoftwareSerial.h" # isama ang "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; walang bisa ang printDetail (uri ng uint8_t, int halaga); void setup () {mySoftwareSerial.begin (9600); Serial.begin (115200); kung (! myDFPlayer.begin (mySoftwareSerial)) {Serial.println (F ("Hindi masimulan:")); Serial.println (F ("1. Mangyaring suriin muli ang koneksyon!")); Serial.println (F ("2. Mangyaring ipasok ang SD card!")); habang (totoo); } 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.setBightness (BRIGHTNESS); } void loop () {kung (digitalRead (IR1pin) == LOW) {LED1show (); } kung (digitalRead (IR2pin) == LOW) {LED2show (); } kung (digitalRead (IR3pin) == LOW) {LED3show (); }} walang bisa LED1show () {myDFPlayer.play (1); para sa (int i = 0; i = 0; i--) {LED1color = CRGB:: Green; FastLED.show (); LED1color = CRGB:: Itim; pagkaantala (100); } myDFPlayer.pause (); } walang bisa LED2show () {myDFPlayer.play (2); para sa (int i = 0; i = 0; i--) {LED2color = CRGB:: Green; FastLED.show (); LED2color = CRGB:: Itim; pagkaantala (100); } myDFPlayer.pause (); } walang bisa LED3show () {myDFPlayer.play (3); para sa (int i = 0; i = 0; i--) {LED3color = CRGB:: Green; FastLED.show (); LED3color = CRGB:: Itim; pagkaantala (100); } myDFPlayer.pause (); }

Inirerekumendang: