Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/LocalSettings.php on line 193

Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/LocalSettings.php on line 197

Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/includes/parser/Parser.php on line 2338

Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/includes/parser/Parser.php on line 2338

Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/includes/parser/Parser.php on line 2338

Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/includes/parser/Parser.php on line 2338

Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/includes/parser/Parser.php on line 2338

Warning: putenv() has been disabled for security reasons in /home/users4/d/debrouilloweb/www/wikidebrouillard/includes/parser/Parser.php on line 2338
[ Wikidébrouillard ] Cube 3x3x3

Cube 3x3x3

De Wikidebrouillard.

Ligne 20 : Ligne 20 :
===Schéma Fritzing===
===Schéma Fritzing===
===Code===
===Code===
-
<pre>
+
<int led1=2;
-
mettre le code entre ces deux balises
+
int led2=3;
 +
int led3=4;
 +
int led4=5;
 +
int led5=6;
 +
int led6=7;
 +
int led7=8;
 +
int led8=9;
 +
int led9=10;
 +
int masse1=11;
 +
int masse2=12;
 +
int masse3=13;
 +
 
 +
void setup(){
 +
  pinMode(led1,OUTPUT);
 +
  pinMode(led2,OUTPUT);
 +
  pinMode(led3,OUTPUT);
 +
  pinMode(led4,OUTPUT);
 +
  pinMode(led5,OUTPUT);
 +
  pinMode(led6,OUTPUT);
 +
  pinMode(led7,OUTPUT);
 +
  pinMode(led8,OUTPUT);
 +
  pinMode(led9,OUTPUT);
 +
  pinMode(masse1,OUTPUT);
 +
  pinMode(masse2,OUTPUT);
 +
  pinMode(masse3,OUTPUT);
 +
}
 +
 
 +
void loop(){
 +
  for (float i=10;i>0.05;i=i-0.05){
 +
    digitalWrite(masse1,LOW);
 +
    digitalWrite(masse2,HIGH);
 +
    digitalWrite(masse3,HIGH);
 +
    digitalWrite(led1,HIGH);
 +
    delay(i);
 +
    digitalWrite(led1,LOW);
 +
    delay(i);
 +
    digitalWrite(led2,HIGH);
 +
    delay(i);
 +
    digitalWrite(led2,LOW);
 +
    delay(i);
 +
    digitalWrite(led3,HIGH);
 +
    delay(i);
 +
    digitalWrite(led3,LOW);
 +
    delay(i);
 +
    digitalWrite(led4,HIGH);
 +
    delay(i);
 +
    digitalWrite(led4,LOW);
 +
    delay(i);
 +
    digitalWrite(led5,HIGH);
 +
    delay(i);
 +
    digitalWrite(led5,LOW);
 +
    delay(i);
 +
    digitalWrite(led6,HIGH);
 +
    delay(i);
 +
    digitalWrite(led6,LOW);
 +
    delay(i);
 +
    digitalWrite(led7,HIGH);
 +
    delay(i);
 +
    digitalWrite(led7,LOW);
 +
    delay(i);
 +
    digitalWrite(led8,HIGH);
 +
    delay(i);
 +
    digitalWrite(led8,LOW);
 +
    delay(i);
 +
    digitalWrite(led9,HIGH);
 +
    delay(i);
 +
    digitalWrite(led9,LOW);
 +
    delay(i);
 +
    digitalWrite(masse1,HIGH);
 +
    digitalWrite(masse2,LOW);
 +
    digitalWrite(masse3,HIGH);
 +
    digitalWrite(led1,HIGH);
 +
    delay(i);
 +
    digitalWrite(led1,LOW);
 +
    delay(i);
 +
    digitalWrite(led2,HIGH);
 +
    delay(i);
 +
    digitalWrite(led2,LOW);
 +
    delay(i);
 +
    digitalWrite(led3,HIGH);
 +
    delay(i);
 +
    digitalWrite(led3,LOW);
 +
    delay(i);
 +
    digitalWrite(led4,HIGH);
 +
    delay(i);
 +
    digitalWrite(led4,LOW);
 +
    delay(i);
 +
    digitalWrite(led5,HIGH);
 +
    delay(i);
 +
    digitalWrite(led5,LOW);
 +
    delay(i);
 +
    digitalWrite(led6,HIGH);
 +
    delay(i);
 +
    digitalWrite(led6,LOW);
 +
    delay(i);
 +
    digitalWrite(led7,HIGH);
 +
    delay(i);
 +
    digitalWrite(led7,LOW);
 +
    delay(i);
 +
    digitalWrite(led8,HIGH);
 +
    delay(i);
 +
    digitalWrite(led8,LOW);
 +
    delay(i);
 +
    digitalWrite(led9,HIGH);
 +
    delay(i);
 +
    digitalWrite(led9,LOW);
 +
    delay(i);
 +
    digitalWrite(masse1,HIGH);
 +
    digitalWrite(masse2,HIGH);
 +
    digitalWrite(masse3,LOW);
 +
    digitalWrite(led1,HIGH);
 +
    delay(i);
 +
    digitalWrite(led1,LOW);
 +
    delay(i);
 +
    digitalWrite(led2,HIGH);
 +
    delay(i);
 +
    digitalWrite(led2,LOW);
 +
    delay(i);
 +
    digitalWrite(led3,HIGH);
 +
    delay(i);
 +
    digitalWrite(led3,LOW);
 +
    delay(i);
 +
    digitalWrite(led4,HIGH);
 +
    delay(i);
 +
    digitalWrite(led4,LOW);
 +
    delay(i);
 +
    digitalWrite(led5,HIGH);
 +
    delay(i);
 +
    digitalWrite(led5,LOW);
 +
    delay(i);
 +
    digitalWrite(led6,HIGH);
 +
    delay(i);
 +
    digitalWrite(led6,LOW);
 +
    delay(i);
 +
    digitalWrite(led7,HIGH);
 +
    delay(i);
 +
    digitalWrite(led7,LOW);
 +
    delay(i);
 +
    digitalWrite(led8,HIGH);
 +
    delay(i);
 +
    digitalWrite(led8,LOW);
 +
    delay(i);
 +
    digitalWrite(led9,HIGH);
 +
    delay(i);
 +
    digitalWrite(led9,LOW);
 +
    delay(i);
 +
    digitalWrite(masse1,HIGH);
 +
    digitalWrite(masse2,LOW);
 +
    digitalWrite(masse3,HIGH);
 +
    digitalWrite(led1,HIGH);
 +
    delay(i);
 +
    digitalWrite(led1,LOW);
 +
    delay(i);
 +
    digitalWrite(led2,HIGH);
 +
    delay(i);
 +
    digitalWrite(led2,LOW);
 +
    delay(i);
 +
    digitalWrite(led3,HIGH);
 +
    delay(i);
 +
    digitalWrite(led3,LOW);
 +
    delay(i);
 +
    digitalWrite(led4,HIGH);
 +
    delay(i);
 +
    digitalWrite(led4,LOW);
 +
    delay(i);
 +
    digitalWrite(led5,HIGH);
 +
    delay(i);
 +
    digitalWrite(led5,LOW);
 +
    delay(i);
 +
    digitalWrite(led6,HIGH);
 +
    delay(i);
 +
    digitalWrite(led6,LOW);
 +
    delay(i);
 +
    digitalWrite(led7,HIGH);
 +
    delay(i);
 +
    digitalWrite(led7,LOW);
 +
    delay(i);
 +
    digitalWrite(led8,HIGH);
 +
    delay(i);
 +
    digitalWrite(led8,LOW);
 +
    delay(i);
 +
    digitalWrite(led9,HIGH);
 +
    delay(i);
 +
    digitalWrite(led9,LOW);
 +
    delay(i);
 +
 
 +
  }>
 +
 
//attention à bien documenter le cod
//attention à bien documenter le cod

Version du 21 janvier 2014 à 16:29

Article incomplet en cours de rédaction
Modèle:Vidéo

Sommaire

Présentation du projet Arduino

Cube led 3x3x3

une deuxième ligne apparait au bon endroit

Liste du matériel

réalisation du projet

Explication

Schéma Fritzing

Code

<int led1=2; int led2=3; int led3=4; int led4=5; int led5=6; int led6=7; int led7=8; int led8=9; int led9=10; int masse1=11; int masse2=12; int masse3=13;

void setup(){

 pinMode(led1,OUTPUT);
 pinMode(led2,OUTPUT);
 pinMode(led3,OUTPUT);
 pinMode(led4,OUTPUT);
 pinMode(led5,OUTPUT);
 pinMode(led6,OUTPUT);
 pinMode(led7,OUTPUT);
 pinMode(led8,OUTPUT);
 pinMode(led9,OUTPUT);
 pinMode(masse1,OUTPUT);
 pinMode(masse2,OUTPUT);
 pinMode(masse3,OUTPUT);

}

void loop(){

 for (float i=10;i>0.05;i=i-0.05){
   digitalWrite(masse1,LOW);
   digitalWrite(masse2,HIGH);
   digitalWrite(masse3,HIGH);
   digitalWrite(led1,HIGH);
   delay(i);
   digitalWrite(led1,LOW);
   delay(i);
   digitalWrite(led2,HIGH);
   delay(i);
   digitalWrite(led2,LOW);
   delay(i);
   digitalWrite(led3,HIGH);
   delay(i);
   digitalWrite(led3,LOW);
   delay(i);
   digitalWrite(led4,HIGH);
   delay(i);
   digitalWrite(led4,LOW);
   delay(i);
    digitalWrite(led5,HIGH);
   delay(i);
   digitalWrite(led5,LOW);
   delay(i);
   digitalWrite(led6,HIGH);
   delay(i);
   digitalWrite(led6,LOW);
   delay(i);
   digitalWrite(led7,HIGH);
   delay(i);
   digitalWrite(led7,LOW);
   delay(i);
   digitalWrite(led8,HIGH);
   delay(i);
   digitalWrite(led8,LOW);
   delay(i);
   digitalWrite(led9,HIGH);
   delay(i);
   digitalWrite(led9,LOW);
   delay(i);
   digitalWrite(masse1,HIGH);
   digitalWrite(masse2,LOW);
   digitalWrite(masse3,HIGH);
   digitalWrite(led1,HIGH);
   delay(i);
   digitalWrite(led1,LOW);
   delay(i);
   digitalWrite(led2,HIGH);
   delay(i);
   digitalWrite(led2,LOW);
   delay(i);
   digitalWrite(led3,HIGH);
   delay(i);
   digitalWrite(led3,LOW);
   delay(i);
   digitalWrite(led4,HIGH);
   delay(i);
   digitalWrite(led4,LOW);
   delay(i);
   digitalWrite(led5,HIGH);
   delay(i);
   digitalWrite(led5,LOW);
   delay(i);
   digitalWrite(led6,HIGH);
   delay(i);
   digitalWrite(led6,LOW);
   delay(i);
   digitalWrite(led7,HIGH);
   delay(i);
   digitalWrite(led7,LOW);
   delay(i);
   digitalWrite(led8,HIGH);
   delay(i);
   digitalWrite(led8,LOW);
   delay(i);
   digitalWrite(led9,HIGH);
   delay(i);
   digitalWrite(led9,LOW);
   delay(i);
   digitalWrite(masse1,HIGH);
   digitalWrite(masse2,HIGH);
   digitalWrite(masse3,LOW);
   digitalWrite(led1,HIGH);
   delay(i);
   digitalWrite(led1,LOW);
   delay(i);
   digitalWrite(led2,HIGH);
   delay(i);
   digitalWrite(led2,LOW);
   delay(i);
   digitalWrite(led3,HIGH);
   delay(i);
   digitalWrite(led3,LOW);
   delay(i);
   digitalWrite(led4,HIGH);
   delay(i);
   digitalWrite(led4,LOW);
   delay(i);
    digitalWrite(led5,HIGH);
   delay(i);
   digitalWrite(led5,LOW);
   delay(i);
   digitalWrite(led6,HIGH);
   delay(i);
   digitalWrite(led6,LOW);
   delay(i);
   digitalWrite(led7,HIGH);
   delay(i);
   digitalWrite(led7,LOW);
   delay(i);
   digitalWrite(led8,HIGH);
   delay(i);
   digitalWrite(led8,LOW);
   delay(i);
   digitalWrite(led9,HIGH);
   delay(i);
   digitalWrite(led9,LOW);
   delay(i);
   digitalWrite(masse1,HIGH);
   digitalWrite(masse2,LOW);
   digitalWrite(masse3,HIGH);
   digitalWrite(led1,HIGH);
   delay(i);
   digitalWrite(led1,LOW);
   delay(i);
   digitalWrite(led2,HIGH);
   delay(i);
   digitalWrite(led2,LOW);
   delay(i);
   digitalWrite(led3,HIGH);
   delay(i);
   digitalWrite(led3,LOW);
   delay(i);
   digitalWrite(led4,HIGH);
   delay(i);
   digitalWrite(led4,LOW);
   delay(i);
   digitalWrite(led5,HIGH);
   delay(i);
   digitalWrite(led5,LOW);
   delay(i);
   digitalWrite(led6,HIGH);
   delay(i);
   digitalWrite(led6,LOW);
   delay(i);
   digitalWrite(led7,HIGH);
   delay(i);
   digitalWrite(led7,LOW);
   delay(i);
   digitalWrite(led8,HIGH);
   delay(i);
   digitalWrite(led8,LOW);
   delay(i);
   digitalWrite(led9,HIGH);
   delay(i);
   digitalWrite(led9,LOW);
   delay(i);
 }>

//attention à bien documenter le cod

e ! </pre>

Liens avec d'autres projets arduino

chercher ici : http://wikidebrouillard.org/index.php/Catégorie:Arduino

Pour aller plus loin

Liens avec le quotidien

quelles peuvent être les applications technologique de ce montage, ou est-ce qu'on retrouve des programme qui y ressemble ?
Portail des ExplorateursWikidébrouillardLéon DitFLOGPhoto mystèreJ'ai FaitPortraits
AR
CO

Cube 3x3x3

Rechercher

Page Discussion Historique
Powered by MediaWiki
Creative Commons - Paternite Partage a l

© Graphisme : Les Petits Débrouillards Grand Ouest (Patrice Guinche - Jessica Romero) | Développement web : Libre Informatique