IDUINO for maker’s life
24 www.openplatform.cc
int val;
void setup()
{ pinMode(Led,OUTPUT);
pinMode(buttonpin,INPUT);
}
void loop()
{
val=digitalRead(buttonpin);
if(val==HIGH)
{ digitalWrite(Led,HIGH); }
else { digitalWrite(Led,LOW); }
}
********Code End********
Module 6: Obstacle Avoidance Sensor
1. Introduction
Infrared obstacle avoidance sensor is designed for the design of a wheeled robot
obstacle avoidance sensor distance adjustable. This ambient light sensor adaptable, high
precision, having a pair of infrared transmitter and receiver, transmitter tubes emit a certain
frequency of infrared, When detecting the direction of an obstacle (reflector), the infrared
receiver tube receiver is reflected back, when the indicator is lit, Through the circuit, the
signal output interface output digital signal that can be detected by means of potentiometer
knob to adjust the distance, the effective distance From 2 ~ 40cm, working voltage of 3.3V-
5V, operating voltage range as broad, relatively large fluctuations in the power supply voltage
of the situation Stable condition and still work for a variety of microcontrollers, Arduino