Group B

Q14: Understanding the connectivity of Raspberry-Pi /Beagle board circuit / Arduino with IR sensor. Write an application to detect an obstacle and notify the user using LEDs.

Obstacle Detection with IR Sensor

Solution and implementation for Q14 from Internet of Things (iotl).

obstacle_detection_ir_sensor.cpp Download
void setup() {
    pinMode(4, OUTPUT);
    pinMode(9, INPUT);
    digitalWrite(4, HIGH);
}

void loop() {
    if (digitalRead(9) == 1)
        digitalWrite(4, HIGH);
    else
        digitalWrite(4, LOW);
}

Other Questions in Internet of Things

See All Available Questions
Download