Table des matières:

Idée de projet d'art inventif bricolage avec lumières LED et son: 3 étapes
Idée de projet d'art inventif bricolage avec lumières LED et son: 3 étapes

Vidéo: Idée de projet d'art inventif bricolage avec lumières LED et son: 3 étapes

Vidéo: Idée de projet d'art inventif bricolage avec lumières LED et son: 3 étapes
Vidéo: #1 ARDUINO - Découverte et Premier Projet (Allumer une LED) 2024, Juillet
Anonim
Idée de projet d'art inventif de bricolage avec des lumières LED et du son
Idée de projet d'art inventif de bricolage avec des lumières LED et du son

Dans cette vidéo, je vais vous montrer comment créer un projet artistique unique à la maison en utilisant une bande LED et du son.

Étape 1: Vidéo du projet

Image
Image

Bande LED -

Lecteur MP3 -

Capteur infrarouge -

Microcontrôleur -

Connecteur -

Adaptateur -

Régulateur de tension -

Intervenant -

Micro SD -

Condensateur -

Résistance -

Interrupteur à bascule -

Outils de soudure -

Étape 2: Schéma et Gerber

Schéma et Gerber
Schéma et Gerber

Obtenez le conseil -

Étape 3: Code source

Code source
Code source

Code source:

#comprendre

#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 LED1couleur[NUM_LEDS_PER_STRIP]; CRGB LED2couleur[NUM_LEDS_PER_STRIP]; CRGB LED3couleur[NUM_LEDS_PER_STRIP]; SoftwareSerial mySoftwareSerial (10, 11); // RX, TX DFRobotDFPlayerMini myDFPlayer; void printDetail (type uint8_t, valeur int); void setup() { mySoftwareSerial.begin(9600); Serial.begin(115200); if (!myDFPlayer.begin(mySoftwareSerial)) { Serial.println(F("Impossible de commencer:")); Serial.println(F("1. Veuillez revérifier la connexion !")); Serial.println(F("2. Veuillez insérer la carte SD !")); tandis que (vrai); } pinMode(IR1pin, INPUT); pinMode (IR2pin, ENTREE); pinMode(IR3pin, INPUT); monDFPlayer.volume(20); monDFPPlayer. EQ(DFPLAYER_EQ_CLASSIC); monDFPlayer.outputDevice(DFPLAYER_DEVICE_SD); FastLED.addLeds(LED1couleur, NUM_LEDS_PER_STRIP); FastLED.addLeds(LED2color, NUM_LEDS_PER_STRIP); FastLED.addLeds(LED3color, NUM_LEDS_PER_STRIP); FastLED.setBrightness(LUMINOSITÉ); } boucle vide() { if(digitalRead(IR1pin) == LOW) { LED1show(); } if(digitalRead(IR2pin) == LOW) { LED2show(); } if(digitalRead(IR3pin) == LOW) { LED3show(); } } void LED1show() { myDFPlayer.play(1); for(int i = 0; i = 0; i--) { LED1couleur = CRGB::Vert; FastLED.show(); LED1couleur = CRGB::Noir; retard (100); } monDFPlayer.pause(); } void LED2show() { myDFPlayer.play(2); for(int i = 0; i = 0; i--) { LED2couleur = CRGB::Vert; FastLED.show(); LED2couleur = CRGB::Noir; retard (100); } monDFPlayer.pause(); } void LED3show() { myDFPlayer.play(3); for(int i = 0; i = 0; i--) { LED3couleur = CRGB::Vert; FastLED.show(); LED3couleur = CRGB::Noir; retard (100); } monDFPlayer.pause(); }

Conseillé: