projets:coop:start

Ceci est une ancienne révision du document !


Coop

  • Porteur du projet : Clément Veiluva enseignant
  • Fichiers utiles : mettre un lien vers un code ou un fichier

Actionner un rideau electrique via un tapis interrupteur pour montrer un carré de bois en or.

Coop

  • Notez ici les références artistiques et techniques, ou autres influences
  • Rideau electrique
  • arduino
  • relai
  • tapis sensitif diy (bouton push)
const int buttonPin = 2;     // the number of the pushbutton pin
const int relai =  4;      // the number of the LED pin
 
// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status
 
void setup() {
  // initialize the LED pin as an output:
  pinMode(relai, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);
}
 
void loop() {
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);
 
  // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
  if (buttonState == HIGH) {
    // turn LED on:
    digitalWrite(relai, HIGH);
  } else {
    // turn LED off:
    digitalWrite(relai, LOW);
  }
}
 
<code>
 
===== Photos et médias=====
Code pour afficher les images du projet :
<code>{{gallery>?&crop&lightbox}}
  • projets/coop/start.1610623610.txt.gz
  • Dernière modification: 2021/01/14 12:26
  • de enseignant