Presentation is loading. Please wait.

Presentation is loading. Please wait.

UCD ElecSoc Robotics Club 2017/2018

Similar presentations


Presentation on theme: "UCD ElecSoc Robotics Club 2017/2018"— Presentation transcript:

1 UCD ElecSoc Robotics Club 2017/2018
Arduino 101 UCD ElecSoc Robotics Club 2017/2018

2 What is Arduino? 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018
In short, Arduino/Genuino boards are essentially programmable microcontrollers. They are used for a wide variety of functions such as prototyping, robotics and personal projects. Arduino is an open source electronics prototyping platform, meaning the software can be distributed and altered without any restrictions. These tutorials have been designed to teach the basics of Arduino/Genuino to absolute beginners and give every member a chance to learn how to code and build cool projects with the help of the Robotics Officers. 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018

3 Arduino/Genuino Uno Layout
Arduino Anatomy Arduino/Genuino Uno Layout 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018

4 External Ports & Reset:
Reset button: Resets the ATmega microcontroller USB port: Used to upload sketches, powering your Arduino/Genuino and communicating with your sketch (via Serial.println()) Power Connector: Accepts voltages between 7-12V. 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018

5 Analogue & Voltage Pins:
Voltage pins: Use these pins to provide power and ground to your circuit Atmega Microcontroller: The heart of your Arduino/Genuino Uno Analogue in: Use these pins with the analogRead() function to read analogue input. 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018

6 Digital Pins: 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018
Pin 13 LED: The only actuator built-in to your Arduino/Genuino Uno. It’s a handy target for a basic blink sketch, but also very useful for debugging. Digital pins: Use these pins to read/control digital input and output. Use the functions digitalRead() and digitalWrite() with all pins, and analogWrite() with pins that have the ~ symbol beside them. 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018

7 Digital and Analogue Pins
Digital pins can only read two states: When there is voltage on, the pin is HIGH In the absence of voltage, the pin is LOW On the other hand, analogue pins contain a value between , which maps to a range from 0 volts to 5 volts. Digital and analogue pins can act as both inputs and outputs, depending how you code them. 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018

8 Building Circuits Basic Principles 0. Arduino 101
UCD ElecSoc Robotics Club 2017/2018

9 New to Circuits? 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018
If you have absolutely no experience building circuits, please talk to a Robotics Officer and ask them to explain the following principles: Voltage, current, resistance Series and parallel circuits Reading circuit diagrams 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018

10 Reading Circuit Diagrams: Important Symbols
Resistor Switch Voltage Source Ground/Earth LED 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018

11 Using a Breadboard 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018
A Robotics Officer will perform a short demonstration on how to build circuits using a breadboard for all beginners. For those of you who are more familiar with breadboards, please see the diagram on the left as a reminder of the connections on the breadboards available in the UCD Electronics Lab 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018

12 Coding An introduction 0. Arduino 101
UCD ElecSoc Robotics Club 2017/2018

13 Variables Data Types 0. Arduino 101
A variable is an item of data used to store a particular value To use a variable, you must declare its data type Data Types The two data types you will use when declaring variables are: int – used for integer variables (whole numbers) float – used for non-integar variables (any number containing a decimal point) 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018

14 UCD ElecSoc Robotics Club 2017/2018
Every Arduino sketch has two main functions: setup() – runs only once (after each reset). Used to initialise variables, pin modes and libraries. loop() – runs continuously after the setup() has completed. Used for your main code. When creating variables, declare them before the setup() function, as shown. To assign a value to a variable later in the code, simply use the = sign. Example: variable = 5. 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018

15 Other Important Functions
pinMode() – used to configure pins to be input or output pins digitalWrite() – used to turn on and off the digital pins digitalRead() – used to check the voltage level of digital pins analogWrite() - used to turn on and off the analogue pins analogRead() – used to check the voltage level of analogue pins Serial.begin() – opens a connection between the Arduino/Genuino and the computer so you can see the input values on you screen Serial.print() – sends information from the Arduin0/Genuino to the connected computer 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018

16 Coding Practice 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018
Each of the project tutorials will demonstrate and explain how to use the relevant functions appropriately, but here are a few basic coding practices to remember: Every line of code must end in a semicolon (;) Use meaningful names for variables Use indentation to keep code organised and legible Use comments to explain complex parts of code To comment, start the line of code with “//” Avoid excessive variables, functions, statements etc 0. Arduino 101 UCD ElecSoc Robotics Club 2017/2018

17 Let’s Go!


Download ppt "UCD ElecSoc Robotics Club 2017/2018"

Similar presentations


Ads by Google