Dans ce tutoriel on va varier automatiquement l’intensité de lumière d’un module LED RGB avec la carte Arduino.
carte Arduino UNO
L’Arduino UNO est une carte de développement microcontrôleur populaire utilisée pour créer des projets électroniques interactifs. Elle est basée sur le microcontrôleur ATmega328 et dispose de 14 broches d’entrée/sortie, de 6 entrées analogiques, de 2 ports série et d’un port USB pour la communication et l’alimentation.
module LED RGB
Un module LED RGB est un module prêt à l’emploi contenant une LED RGB (Red Green Blue) et des composants électroniques de commande. Il est généralement utilisé pour afficher des couleurs variables dans les projets de décoration ou de signalisation.
des fils de connexion
Les fils de connexion sont essentiels pour relier les composants électroniques dans un circuit électronique, y compris une carte Arduino. Il existe différents types de fils de connexion en fonction de leur application, comme les fils à gaine thermorétractable, les fils à cosse et les fils tressés.
Pour utiliser un module LED RGB avec la carte de développement l’Arduino : On Connecte le module LED RGB à la carte de développement en suivant les instructions du fabricant et respectant les bonnes polarités.
On connecte :
Voici le programme qui varie automatiquement l’intensité de lumière une LED RGB avec l’Arduino.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
void setup(){ pinMode(0,OUTPUT); //règle la borne numérique numéro 0 de la carte Arduino en mode sortie pinMode(1,OUTPUT); //règle la borne numérique numéro 1 de la carte Arduino en mode sortie pinMode(2,OUTPUT); //règle la borne numérique numéro 1 de la carte Arduino en mode sortie } void loop(){ //le module LED s’allume en rouge et vert digitalWrite(0,HIGH); digitalWrite(1,HIGH); digitalWrite(2,LOW); delay(2000); //le module LED s’allume en rouge digitalWrite(0,HIGH); digitalWrite(1,LOW); digitalWrite(2,LOW); delay(2000); //le module LED s’allume en rouge et bleu digitalWrite(0,LOW); digitalWrite(1,HIGH); digitalWrite(2,LOW); delay(2000); //le module LED s’allume en vert digitalWrite(0,HIGH); digitalWrite(1,LOW); digitalWrite(2,HIGH); delay(2000); //le module LED s’allume en rouge, vert et bleu digitalWrite(0,HIGH); digitalWrite(1,HIGH); digitalWrite(2,HIGH); delay(2000); } |
mawartoto 20-11-2323
Generally I do not read post on blogs, however I wish to say that this write-up very compelled me to check out and do so! Your writing style has been amazed me. Thank you, quite nice article.
slot mawartoto 18-11-2323
Hi, i think that i noticed you visited my web site thus i got here to go back the favor?.I'm trying to find things to enhance my website!I guess its ok to make use of a few of your ideas!!
mawartoto 18-11-2323
Hey! Quick question that's entirely off topic. Do you know how to make your site mobile friendly? My web site looks weird when browsing from my iphone4. I'm trying to find a template or plugin that might be able to fix this issue. If you have any suggestions, please share. With thanks!
mawartoto 14-11-2323
Normally I don't read post on blogs, however I would like to say that this write-up very forced me to take a look at and do it! Your writing taste has been amazed me. Thank you, very great article.
mawartoto 14-11-2323
When I originally commented I seem to have clicked the -Notify me when new comments are added- checkbox and from now on every time a comment is added I get four emails with the exact same comment. Is there a means you are able to remove me from that service? Kudos!
mawartoto 02-11-2323
Hi there to all, how is the whole thing, I think every one is getting more from this site, and your views are nice in favor of new visitors.
mawartoto 14-10-2323
Hey there just wanted to give you a quick heads up. The text in your content seem to be running off the screen in Internet explorer. I'm not sure if this is a formatting issue or something to do with web browser compatibility but I thought I'd post to let you know. The layout look great though! Hope you get the issue solved soon. Thanks
idn slot 14-10-2323
I’m not that much of a online reader to be honest but your sites really nice, keep it up! I'll go ahead and bookmark your website to come back later on. Cheers
idn toto terpercaya 06-10-2323
I'm gone to tell my little brother, that he should also visit this weblog on regular basis to take updated from most recent news update.
idn toto terpercaya 06-10-2323
hey there and thank you for your info – I've certainly picked up something new from right here. I did however expertise several technical points using this web site, since I experienced to reload the site a lot of times previous to I could get it to load correctly. I had been wondering if your web host is OK? Not that I am complaining, but sluggish loading instances times will sometimes affect your placement in google and can damage your high-quality score if advertising and marketing with Adwords. Well I am adding this RSS to my email and could look out for much more of your respective exciting content. Make sure you update this again very soon.
mawartoto slot 18-09-2323
Unquestionably believe that which you stated. Your favorite reason seemed to be on the net the simplest thing to be aware of. I say to you, I certainly get annoyed while people think about worries that they just don't know about. You managed to hit the nail upon the top as well as defined out the whole thing without having side effect , people could take a signal. Will likely be back to get more. Thanks
mawartoto 18-07-2323
It's in reality a nice and helpful piece of info. I am happy that you simply shared this useful info with us. Please keep us informed like this. Thanks for sharing.