Arduino code and video Infrared Obstacle Avoidance module

This is the Arduino code for Infrared Obstacle Avoidance module

This video shows you how to use Infrared Obstacle Avoidance module.

 * This is the Arduino code Infrared Obstacle Avoidance module
 * watch the video for details and demo
 *  * 
 * Written by Ahmad Nejrabi for Robojax Video channel
 * Date: Dec 28, 2017, in Ajax, Ontario, Canada
 * Permission granted to share this code given that this
 * note is kept with the code.
 * Disclaimer: this code is "AS IS" and for educational purpose only.
 * this code has been downloaded from
void setup() {
 pinMode(8, INPUT);// set pin as input


void loop() {
  //Written for Robojax on Dec 28, 2017
  int detect = digitalRead(8);// read obstacle status and store it into "detect"
  if(detect == LOW){
   Serial.println("Obastacle on the way"); 
   Serial.println("All clear");