Your SlideShare is downloading. ×
Hello Arduino.
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Hello Arduino.

413
views

Published on

What is a "microcontroller"? …

What is a "microcontroller"?
This slideshow is an introduction to the concept of a micro, an overview of several types and finally, a focused intro to Arduino and how to program one.


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
413
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • 1. There are many ways to write one given algorithm\n2. An algorithm requires certain assumptions\n3. An algorithm includes decision making\n4. A complex algorithm should be broken down into modular pieces.\n
  • \n
  • \n
  • \n
  • The computer needs to know what type of data you’re going to be storing, so it knows how much memory to set aside. ints take up less room than floats. \n
  • If you forget, check the reference on the website.\n
  • \n
  • Transcript

    • 1. Our methods so far:This circuit is a “one-liner”Not many possibilities for interactionCircuits hard-wired for specific purposesMaking changes requires you to re-wire, snip, de-solder, etc...
    • 2. What is a “microcontroller” ?•A small, inexpensive computer. Less sophisticated than your mac... think calculator•Good for taking INPUT data, processing it, OUTPUTTING something.•Route several different inputs to outputs, one input to many outputs, etc...•Many electronic devices with any “smarts” whatsoever have some microcontroller.•Higher level vs. Lower lever (Arduino is mid) Wiring Gainer BX 24 PIC micro
    • 3. Where does themicrocontroller fit in?As an input...Count button clicksSense pressureMultiple switchesHow long switch is held down
    • 4. As an output...Automate the lightsAnimate multiple lights in a sequence
    • 5. Put em together...Interactive Devices
    • 6. The “Big 4”Concepts-Digital Output-Digital Input-Analog Output-Analog Input
    • 7. WHAT IS ARDUINO?
    • 8. Arduino-A “single board” microcontroller and a software suite for programming it.-Programming language is based on WIRING (similar to C++) -IDE is based on PROCESSING, so it looks friendly.-An Italian production (IVREA Institute)-USB to Serial interface. I/O pins. Accepts shields and components easily. Inexpensive & open-source-Loaded with Atmel AVR microcontroller chips. Preinstalled “bootloader” makes it easy to program right out of the box!-Clones exist.
    • 9. Anatomy of an Uno- 28 pin IC (brain). ATmega168, 328 or similar.- A variety of components, LEDs, a crystal oscillator, a 5V regulator, etc.- FTDI chip that converts USB to Serial for easy communication with your pute.- 14 Digital I/O pins. (0-13)- 6 Analog In pins (0-5)- 6 pins can be used as Analog Out (3,5,6,9,10,11)
    • 10. DIGITAL I/O PINS USB 5VREGULATOR MICROCONTROLLEREXTERNAL POWER POWER ANALOG IN
    • 11. Each DIGITAL OUT pin acts like a mini 5V power supply.Don’t forget about Ground! + 9V 470 instead of...
    • 12. 220ΩLED
    • 13. Now we need to give the board instructions on what to do...
    • 14. What is Code?A set of instructions (“an algorithm”)that tells the board exactly what to do,for how long and in what order. Aprocedure, a program.Knitting a scarf:Row 1: (RS) *K2, P2* acrossRows 2, 3 & 4: Repeat Row 1Row 5: (RS0 *K2, P2, C8F* Repeat to last 4 sts, K2, P2Row 6: Repeat Row 1Repeat rows 1-6 for desired length, ending with row 4Bind off in K2, P2 pattern
    • 15. Hiking directions to Point BreakFrom the North:-Follow the trail from the Nature Center-Turn right at the Water Tower, walk up to the Old Oak Tree-Follow directions from the Old Oak Tree.From the South:-From the hPicnic Grove, follow the Botany Trail-Turn right on the South Meadow Trail-Turn right on the Meadow Ranch Trail, walk until you see the OldOak Tree-Follow directions from the Old Oak Tree.From the Old Oak Tree:-Follow the path under the tree-Turn right onto the Long Hill Trail-Follow the trail until you reach Point Break
    • 16. A code snippet from PROCESSING Produces This:* Arduino is based off ofsimilar. Don’t IDE. So they look very Processing’s mix the two up though.
    • 17. Anatomy of anArduino ProgramButtons for common tasks Comments Variables Setup & Loop Functions Message Area Console
    • 18. Structure Up Top: “Declare” and “Assign” any variables you’re going to be using. SETUP: The code in this block runs only once when the program begins. LOOP: The code in this block runs after the setup, 100’s of times a second. Each line of code runs once from top to bottom.Once the loops is entered, we stay there until the Arduino is unplugged.
    • 19. Breakdown Make a few notes to myself, so when Ireturn to this later, I can remember more easily... Give the #13 a nickname so I can use itmultiple times. If I change 13 to 10 now, I only have to change it once, here!Make sure Arduino knows pin 13 (nicknamed “led”) is going to serve as OUTPUT.Specify some instructions for how long to turn the LED on/off. This part will repeat over and over again.If you remove the last delay(1000); what happens? Can you make the LED blink “SOS”?
    • 20. A few definitions Variable: Store a value (integer, decimal number, true/false value, etc.) in computer memory so you can use it many times throughout the life of the program. Variables have two steps: declare and assign. Sometimes these happen on one line, like you see below. So this: Declare that that Assign it a value of you’re making a 13, representing the variable called pin that the LED is “led” of type int. connected to! Is identical to this:... gets assigned to what’s on the left. = What’s on the right hand side of the As far as the Arduino equals sign... is concerned.
    • 21. A few definitionsFunction: Code modules that can be “called” in your program. A function is actuallya ‘nickname’ given to other lines of code, written and stored elsewhere. Arduino hasa large selection of existing functions. Each one does something specific like “send5v to pin X” or “delay for one second”. Functions can be customized sometimes, with“parameters” You can write your own functions too! These are just the ones that come digitalWrite takes with Arduino. the name of the two parameters, function begin which pin? and what called. Note the () state? It’s like saying “set ‘led’ (13) to HIGH”. Meaning... “Send 5V to pin 13”
    • 22. For more, visit the Arduino website:arduino.ccand check out their tutorials:http://arduino.cc/en/Tutorial/Foundations