Iot 8
Iot 8
#include <Arduino.h>
void loop() {
// Read the value from the IR sensor
int sensorValue = digitalRead(irSensorPin);
displayDigit(obstacleCount);
if(obstacleCount==9)
{
obstacleCount=0;
}
void loop()
{
int val = digitalRead(inputPin); // read input value
if (val == HIGH)
{
Serial.println("obstacle not detected");
}
else
{
Serial.print("obstacle detected:");
Serial.println(count);
count = count + 1;
if (count == 10)
{
count = 0;
}
}
delay(500);