titusz99 Creative Commons License 2017.02.21 0 0 2848

// potmétert tekergetheted bármikor

// Ha nyomod a gombot világít potmétertől függően

// Ha nem nyomod nem világít

 

void loop(){

  sensorValue = analogRead(analogInPin);
  outputValue = map(sensorValue, 0, 1023, 0, 255);

  if (digitalRead(buttonPin) ==HIGH) {
     digitalWrite(ledPin, HIGH);
     analogWrite(analogOutPin, outputValue);

  }
  else {
     digitalWrite(ledPin, LOW);
     analogWrite(analogOutPin, 0);
  }
}

 

 

 

Előzmény: ucs69 (2847)