Skip to content

Instantly share code, notes, and snippets.

View yugn27's full-sized avatar
:octocat:
Stay foolish. Stay hungry

Yash Nayak yugn27

:octocat:
Stay foolish. Stay hungry
View GitHub Profile
@yugn27
yugn27 / UltrasonicSensor
Created July 26, 2018 10:47
Atal Tinkering Chapter-Ultrasonic Sensor
const int trigPin = 2;
const int echoPin = 4;
void setup()
{
Serial.begin(9600);
}
void loop()
{
long duration, inches, cm;
pinMode(trigPin, OUTPUT);