projets:coop:start

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
Prochaine révision Les deux révisions suivantes
projets:coop:start [2021/01/14 11:18]
enseignant Créé depuis le formulaire creerunprojet
projets:coop:start [2021/01/14 12:27]
enseignant [Code simple pour arduino un bouton active un relai]
Ligne 1: Ligne 1:
 ====== Coop ====== ====== Coop ======
-  * Porteur du projet : Clément Veiluva [[:user:enseignant|enseignant]]+  * Porteur du projet : Clément Veiluva 
   * Fichiers utiles : //mettre un lien vers un code ou un fichier//   * Fichiers utiles : //mettre un lien vers un code ou un fichier//
  
Ligne 15: Ligne 15:
  
 ===== Notes techniques et matériaux ===== ===== Notes techniques et matériaux =====
-Liste de matériel et composants nécessaires (documents avec photo si possible...)+  * Rideau electrique 
 +  * arduino 
 +  * relai 
 +  * tapis sensitif diy  (bouton push) 
 + 
 + 
 +==== Code simple pour arduino un bouton active un relai ==== 
 + 
 +<code c+> 
 +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 pressedIf 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===== ===== Photos et médias=====
  • projets/coop/start.txt
  • Dernière modification: 2021/01/14 17:14
  • de enseignant