20
ARDUINO A guide created by a super tech girl in Grade 9

Arduino Intro Guide 2

Embed Size (px)

Citation preview

Page 1: Arduino Intro Guide 2

ARDUINOA guide created by a super tech girl in Grade 9

Page 2: Arduino Intro Guide 2

What is an Arduino■ Arduino is project that created microcontroller-based kits for building

digital devices and interactive objects that can sense and control physical devices.

Page 3: Arduino Intro Guide 2

HardwareRed Board

Bread Board

Page 4: Arduino Intro Guide 2

Red Board

■ The Redboard is development platform that enables quick-and-easy project prototyping.

■ It can interact with real-world sensors, control motors, display information, and perform near-instantaneous calculations

Page 5: Arduino Intro Guide 2

Barrel jack (power in) -1 LED (TX:

transmitting) -4

usb port -2 Reset

button -8

LED (pin 13: trouble shooting) - 5

pins -6

LED (on flash) -7 ISCP pins

-9

LED (rx: receving) -3

pins - 10

Page 6: Arduino Intro Guide 2

Diagram explanation

■ 1 = power in, can be used with 9V or 12V battery ■ 2 = power in, provides power and communicates with your board when plugged into your computer via

USB.■ 3 = shows when the FTDI chip is receiving data from the microcontroller ■ 4 = shows when the FTDI chip is transmitting fata bits to the microcontroller ■ 5 = shows if your program is running properly■ 6 = these various pins can be used for inputs, outputs, power and ground■ 7 = indicates when the redboard is on■ 8 = a way to manually reset your redboard, which makes the code restart■ 9 = this is for ‘in-circuit serial programming’ used if you want to bypass the bootloader■ 10 = these various pins can be used for inputs, outputs, power and ground

Page 7: Arduino Intro Guide 2

Bread Board

■ The breadboard has multiple power and ground pins that you can connect to the power rails or other rows that link back to the red board

Page 8: Arduino Intro Guide 2

What is a Circuit?

■ A circuit is an electrical loop with a starting point and an ending point with any number of components in between

■ Circuits can include resistors, diodes, inductors, sensors, motors and a variety of other components

Page 9: Arduino Intro Guide 2

LED’s

Positive end

Negative end

a light-emitting diode (LED) is a semiconductor device that emits light when an electric current is passed through it

Page 10: Arduino Intro Guide 2

Understanding Code

■ syntax – ‘word glue’ words like if, else, void; mathematical stuff like +, -, *, =, % and logic like ! (not), && (and).

■ Sketch – the text or code of a software program written for the Arduino. We use the IDE to write, save and load sketches.

■ Function – computer instructions that preform some action or respond to triggers like buttons or sensors.

■ Setup – the first function you’ll see in most Arduino sketches. This code is run first before anything else, and its only run once when the Arduino powers up.

Page 11: Arduino Intro Guide 2

More vocab

■ Loop – this is the second and most important function. Required for every sketch, its where the Arduino does all the work, constantly looping over on the same code to do what you want.

■ Variable – a special word that represents a letter or number that can change. We show variables as black in the IDE.

■ Ex: int onTime = 250;■ (data type, variable name, initial value)

Page 12: Arduino Intro Guide 2

Basic Arduino Circuit

Page 13: Arduino Intro Guide 2

Explanation

Verify

upload

New sketch Open sketch Save sketch Open

serial monitor

Comment(Regular text to help understand)

Line ending in “;” semicolon

“setup” function

“loop” function

Page 14: Arduino Intro Guide 2

Further examples

Page 15: Arduino Intro Guide 2

Example

This is a circuit about push buttons. When the LED turns on you can push either button and watch as the light turns on and off

Page 16: Arduino Intro Guide 2

Example

This circuit uses a flex sensor to move the servo (fan). The more you move the flex sensor the servo will move accordingly

Page 17: Arduino Intro Guide 2

Example This circuit is a Simon Says game that uses LED’s, buttons, buzzers and resistors. Once powered, the buzzer will beep a few times and all 4 LED’s will blink. The game only begins once you press a button. Once the game has started, a random LED will blink. Press the button associated with that colour to replicate that pattern.

Page 18: Arduino Intro Guide 2

Reflection

■ during the few weeks that I was able to experiment with the Arduino I did more hands on building the circuits than coding them. Despite how much fun I had with that, I still would have liked to learn the code more than I did. I stuck mainly within the book examples, only tweaking little things as to not blow up my laptop (I was warned and didn't want to risk it). If I was given more time, I would have liked to experiment and create more circuits with my own skill. If you ever get the chance to mess around with an Arduino I fully advise it.

Page 19: Arduino Intro Guide 2

Reflection 2

■ Having this experience was extremely enjoyable and certainly encourages me to continue pursuing IT in my later years of high school. Although this has been a great experience, if I was to go into the tech field for study in later years, I would not go down this path. I would prefer to look more at the coding side of things than sticking to circuits. Although I will proudly be able to say that I was able to use an Arduino and am perfectly capable to branch out from this and go onto different coding languages.

Page 20: Arduino Intro Guide 2

Thank you Mrs Schneider!