meta données pour cette page
  •  

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
photosenseurchaser [2014/09/24 16:49] – créée André Girardphotosenseurchaser [2015/02/18 16:27] (Version actuelle) André Girard
Ligne 1: Ligne 1:
-<sxh>+<sxh java>
 int sensorPin = A0;    // select the input pin for the potentiometer int sensorPin = A0;    // select the input pin for the potentiometer
 int sensorValue = 0;  // variable to store the value coming from the sensor int sensorValue = 0;  // variable to store the value coming from the sensor
 int timer = 50; int timer = 50;
 +int lowPin = 6;
 +int highPin = 13;
  
 void setup() { void setup() {
Ligne 24: Ligne 26:
  
 void chaserUp(){ void chaserUp(){
-  for (int thisPin = 6; thisPin <=13; thisPin++) { +  for (int thisPin = lowPin; thisPin <= highPin; thisPin++) { 
     // turn the pin on:     // turn the pin on:
     digitalWrite(thisPin, HIGH);        digitalWrite(thisPin, HIGH);   
Ligne 34: Ligne 36:
  
 void chaserDown(){ void chaserDown(){
-  for (int thisPin = 13; thisPin >= 6; thisPin--) { +  for (int thisPin = highPin; thisPin >= lowPin; thisPin--) { 
     // turn the pin on:     // turn the pin on:
     digitalWrite(thisPin, HIGH);     digitalWrite(thisPin, HIGH);