
DIY Follow Me Robot
Here, you will learn how to make an autonomous robot which will follow the object in front of it.
There are 28 digital I/O pins under evive’s magic lid, where digital I/O stands for digital input and output. These 28 pins can take a digital signal as an input and also give a digital signal as an output. A digital pin on evive can have either of the three states: HIGH, LOW or FLOATING(this means logic 1,0 or either in terms of binary) and it remains in either one of them when it is used as input or as output. Now how to decide what is state of a digital pin?
The state of the digital pin is determined by the fact that how much voltage it gives when it is used as an output pin or how much voltage is applied to it when it is used as an input pin. As evive is made on Arduino mega hence it works on the logic level of 5v. This means that the states will be considered as follows:
State | Description |
---|---|
0 or LOW | When output or input at digital pin is in voltage range of 0V to 1.5V. |
1 or HIGH | When output or input at digital pin is in voltage range of 3.3V to 5V. |
Floating | When the input to a digital pin is in voltage range of 1.5V to 3.3V its logic level can't be determined definitely. evive can randomly consider it as 1 or 0. Means if the state of the pin is read on evive then it fill be 1 sometimes and sometimes it will 0. |
An LED is a small device that glows when electricity passes through it. They are like tiny light bulbs but use less energy as compared to the conventional filament bulbs.. They’re also more energy efficient. so they don’t tend to get hot. LED bulbs and tube lights have picked up the front stage because they use less energy as compared to the conventional filament bulbs.
evive has an LED (named Pin 13) whose positive terminal is connected internally to digital pin 13 and negative terminal is connected to GND i.e. ground. A resistor is present between the digital pin 13 and the positive terminal of LED to prevent excess current from flowing through the LED. When digital pin 13 is HIGH, current passes through LED and it glows; when it is LOW, no current passes through LED. Hence, it does not glow.
In order to declare a digital pin as an output in evive that pin should be configured as OUTPUT using pinMode function available on Arduino IDE. This can be done using the following statement:
pinMode(pin, OUTPUT);
where the pin is the digital pin number you want to initialize as output.
Using the digitalWrite() function in Arduino IDE, you can set a digital pin either to a HIGH or LOW value.
In this Arduino IDE sketch, we will turn ON the LED for 1 second, then turn it OFF for another 1 seconds and repeat, i.e. make it blink.
Below is the sketch:
0 items in the cart ($0.00)