Posts

Showing posts from June, 2018

Understanding the Arduino Code

Image
Structure An Arduino sketch runs in two parts: void setup() This is where you place the initialization code that is the instructions that sets up the board before the main loop of the sketch starts. void loop() This contains the main code of your sketch. It contains a set of instructions that get repeated over and over until the board is switched off. Special symbols Arduino includes a number of symbols to delineate lines of code, comments, and blocks of code. ; (semicolon) Every instruction (line of code) is terminated by a semicolon. This syntax lets you format the code freely. You could even put two instructions on the same line, as long as you separate them with a semicolon.  comments(// or /*........*/) These are portions of text ignored by the Arduino processor, but are extremely useful to remind yourself (or others) of what a piece of code does. A comment can consist of one line or multi Constants Arduino includes a set of predefined k

Controlling LEDs with an IR remote

Image
In this post, I will describe how to connect your TV remote to Arduino through a simple IR sensor.  As you may be aware, the TV remote is based on the principle of using infrared light as the medium of communication. The IR LED is connected to the end of the circuit board of the remote and emits infrared light which is sensed by the sensor placed at the receiver of the TV. In this project, we will capture the IR light signals sent by the remote and use it to control LEDs in the way we want. The Completed Project Materials required Arduino UNO USB 2.0 Cable Type A/B Any TSOP IR reciever(in this project i used a TSOP1838 IR reciever) LED(s) IR remote (in this project we will use a TV remote, but you can also use any other IR remote) Jumper wires Breadboard Downloading the IR library Libraries are used to extend the Arduino environment. We need to install libraries to work with different sensors. The IR library can be downloaded from https://github.com

Getting started with Arduino UNO

Image
About Arduino Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. You can tell your board what to do by sending a set of instructions to the micro-controller on the board. In this blog, I will give you a brief description of the Arduino Uno board. Components of an Arduino Uno Analog Reference pin (orange) Digital Ground (light green) Digital Pins 2-13 (green) Digital Pins 0-1/Serial In/Out - TX/RX (dark green) - These pins cannot be used for digital i/o (digitalRead and digitalWrite) if you are also using serial communication (e.g. Serial.begin). Reset Button - S1 (dark blue) In-circuit Serial Programmer (blue-green) Analog In Pins 0-5 (light blue) Power and Ground Pins (power: orange, grounds: light orange) External Power S