Skip to main content
added 20 characters in body
Source Link
jfpoilpret
  • 9.2k
  • 7
  • 38
  • 54

// When first time program launches it confused to press push button twice. Well replace it with this

if (x == 1) { // Toggle on digitalWrite(ledPin, HIGH); x = 0;

// When first time program launches it confused to press push button twice. Well replace it with this

if (x == 1) {
    // Toggle on
    digitalWrite(ledPin, HIGH);
    x = 0;
} else {
    // Toggle off
    digitalWrite(ledPin, LOW);
    x = 1;
}

// When first time program launches it confused to press push button twice. Well replace it with this

if (x == 1) { // Toggle on digitalWrite(ledPin, HIGH); x = 0;

} else {
  // Toggle off
  digitalWrite(ledPin, LOW);
  x = 1;
}
// When first time program launches it confused to press push button twice. Well replace it with this

if (x == 1) {
    // Toggle on
    digitalWrite(ledPin, HIGH);
    x = 0;
} else {
    // Toggle off
    digitalWrite(ledPin, LOW);
    x = 1;
}
Source Link

// When first time program launches it confused to press push button twice. Well replace it with this

if (x == 1) { // Toggle on digitalWrite(ledPin, HIGH); x = 0;

} else {
  // Toggle off
  digitalWrite(ledPin, LOW);
  x = 1;
}