Copyright 2021 - All rights reserved.
This document is geared towards providing exact and reliable information in regards to the topic and issue covered. The publication is sold with the idea that the publisher is not required to render accounting, officially permitted or otherwise qualified services. If advice is necessary, legal or professional, a practiced individual in the profession should be ordered.
- From a Declaration of Principles which was accepted and approved equally by a Committee of the American Bar Association and a Committee of Publishers and Associations.
In no way is it legal to reproduce, duplicate, or transmit any part of this document in either electronic means or printed format. Recording of this publication is strictly prohibited, and any storage of this document is not allowed unless with written permission from the publisher. All rights reserved.
The information provided herein is stated to be truthful and consistent, in that any liability, in terms of inattention or otherwise, by any usage or abuse of any policies, processes, or directions contained within is the solitary and utter responsibility of the recipient reader. Under no circumstances will any legal responsibility or blame be held against the publisher for any reparation, damages, or monetary loss due to the information herein, either directly or indirectly.
Respective authors own all copyrights not held by the publisher.
The information herein is offered for informational purposes solely and is universal as so. The presentation of the information is without a contract or any type of guarantee assurance.
The trademarks that are used are without any consent, and the publication of the trademark is without permission or backing by the trademark owner. All trademarks and brands within this book are for clarifying purposes only and are owned by the owners themselves, not affiliated with this document.
Table of Contents
A Comprehensive Beginner's Guide
to learn the Realms of Arduino from A-Z
Advanced Methods and Strategies
to Learn Arduino Programming
Arduino
Programming
A Comprehensive Beginner's Guide to learn the Realms of Arduino from A-Z
Stuart Nicholas
Introduction
The Internet of Things concept is fashionable, which refers to the ability to interact with physical devices, obtaining information/metrics (e.g., temperature, humidity, etc.) and sending commands/actions (e.g., opening the door, turning on air conditioning, etc.).
The concept, which is not new, implies collaboration between electronics professionals, programmers, and even DBAs. This book is suitable for developers and DBAs who have little knowledge of electronics, giving them an introduction to using Arduino, one of the most well-known electronics platforms used in this area.
In this section, we will make a brief introduction to the Arduino, which is basically a board with a programmable microcontroller, cheap, and easy to use.
The first thing we have to be clear about is that it is a microcontroller and how it differs from the microprocessor. We have all ever come into contact with both concepts, that is, we all have a computer at home, whether desktop, portable, etc.
Well, the core of our computers is a microprocessor, a chip in charge of performing complex operations from some instructions (which we will call program) and some input data obtaining some output data. To process and store this data, we need to connect the microprocessor to RAM and other I / O devices (Input / Output), which are connected through the motherboard.
Defined the microprocessor in a concise way, and taking into account that we had said that the microprocessor needs to be connected to the memory through the motherboard, in the microcontroller, we have both the memory where we store the program, and the memory where it is stored data, in the same assembly (on the same chip).
Sorry if I have taken licenses to define it, I know there are several more differences, such as the location of the data memory and program in reference to the microprocessor.
Where Do I Find a Microcontroller?
We find it in most electronic devices that we use every day, such as remote controls, watches, televisions, cars, and much more. The importance of knowing how they work and how they are programmed opens up many doors.
Arduino
A few years ago, a free project, called Arduino , appeared, which facilitated access to this class of devices for students since it is an open hardware-based board (its design is free and can be reproduced by anyone).
Initially, the board was connected through a USB port to program it (it usually is done based on its IDE that can be found here ). Arduino programming was not done at a low level with assembler like many microcontrollers (from now on we will call them PICs), but it is done with a language more understandable by most of us, C / C ++ (the basic reference to the language we found here and examples on this route ).
With these elements, a programmer who does not know about PICs would be able to program the Arduino in a short time.
The UNO version board consisted of 14 digital I / O pins, of which 2 had a serial connection. These pins are useful for most basic sensors, or for relays, actuators, etc., which only have two states, on or off (or with the Arduino constants HIGH and LOW). It also has six analog pins, capable of reading up to 1024 voltage levels, called analog port resolution. These are used to read sensors that give us different voltage ranges depending on their state, such as heat resistance, variable resistance, etc.
Basically, with the structure of the Arduino UNO, anyone can enter the world of PIC programming. But, for larger projects, more power is needed, with which the Arduino boys were creating plates and improved versions of the Arduino UNO. I expose a few:
Arduino Leonardo
It is the first evolution of the Arduino Mega, in fact, it has the same ports, but the PIC is different, with greater capacity and higher working frequency. Another difference is the USB port, which at the same time of being used to upload the program, can use the USB as a host; that is, we can use it as a keyboard, etc ... Another inclusion is the SDA and SCL ports, used for devices that communicate through the I2C protocol.
Arduino Mega 2560
For those who fall short, the Leonardo designed the Arduino Mega 2560, with much more speed in the microcontroller and many more digital (54 pins) and analog (16 pins) ports. We have the pins for I2C like Leonardo (although they change position).
This design is also the Arduino Mega ADK, which is a modified board of the Mega 2560, but a USB host port is added. Google has designed several projects with this board and its flagship, Android, an example you have on this page .
Another evolution is the Arduino DUE, with the same design as the Mega 2560 but with a 32-bit microprocessor. It is much faster than the Mega 2560.
Arduino YUN
Basically, this board has the same pin and processor characteristics as the Arduino Leonardo, but a microcomputer has been incorporated where a small Unix resides, which allows us to mount fundamental web servers. This board is mostly used for projects in which the sensors have to report through an Ethernet network quickly and easily.
More developments will come in the future, merging the power of Arduino boards with computer motherboards and offering us the possibility of creating a multitude of projects, with unlimited power and scalability.