Tell us about yourself!

Complete Your Profile
  • MayankK25 commented on jsvester's instructable Simple Arduino and HC-SR04 Example2 years ago
    Simple Arduino and HC-SR04 Example

    Very nice !

    Thanks for writing this up - worked like a charm. Minor code suggestion : int ledState = distance < 4;digitalWrite(led, ledState); digitalWrite(led2, !ledState);can replace - if (distance < 4) { // This is where the LED On/Off happens digitalWrite(led,HIGH); // When the Red condition is met, the Green LED should turn off digitalWrite(led2,LOW);} else { digitalWrite(led,LOW); digitalWrite(led2,HIGH); }

    View Instructable »