arduino

Subdecks (1)

Cards (39)

  • Arduino
    An open-source development board used for projects and prototyping
  • The Arduino Uno is the most popular Arduino board and the one we will be using
  • Microprocessor
    The main black rectangle with silver pins on the Arduino, where the code we write will be stored
  • Input/Output pins (IO pins)

    The black plastic holes on each edge of the Arduino that we can connect sensors, buttons, lights, and motors to
  • Connecting various sensors, buttons, lights, and motors to the pins will allow us to bring in information, process it in the microprocessor, and move or display information based on those inputs
  • Many Arduino programs are simply turning things on or off based on input from a switch or sensor
  • Tinkercad
    An online tool that makes it easier to develop circuits with an Arduino
  • Tinkercad circuit editor

    • Connect different components to the Arduino, add code, and simulate what it would be like if we uploaded the code to our Arduino circuit
  • Breadboard
    • A tool used to route electricity and connect components in an Arduino circuit
  • Power rail
    The red(+) vertical rail on a breadboard used for power
  • Ground rail

    The black(-) vertical rail on a breadboard used for ground
  • Blinking LED circuit
    1. Place resistor
    2. Place LED
    3. Connect resistor to power rail
    4. Connect LED cathode to ground rail
    5. Connect power and ground rails to Arduino
  • To control the LED, we have to control the electricity flowing through it
  • Placing a resistor
    1. Connect the resistor to the power rail
    2. Connect the LED cathode to ground rail
    3. Connect the power rail to the 3.3V pin
    4. Connect the ground rail to a GND pin
  • Placing the LED
    Rotate the LED and place it such that the anode is in a hole in the same row as the right side of the resistor
  • Coding the Arduino

    1. Turn the LED on
    2. Wait one second
    3. Turn the LED off
    4. Wait one second
  • Increasing the resistance to 10K Ohms makes the LED dimmer
  • Decreasing the resistance to 10 Ohm makes the LED brighter and a caution indicator appears near the LED
  • Making the LED blink faster

    Use control and variable code blocks
  • Potentiometer
    • Allows varying the brightness of the LED
  • Controlling the LED with a button

    1. Connect one button prong to Digital Pin 2
    2. Use the button to route D2 to HIGH when pressed and LOW when not pressed
    3. Put a 10k Ohm resistor between the button and ground rail to prevent a short circuit
  • Coding the Arduino with a button

    1. Read D2
    2. If D2 is HIGH, set D13 to HIGH
    3. If D2 is LOW, set D13 to LOW
  • Toggling the LED when the button is pressed
    1. Use a variable to track if the LED is on or off
    2. When the button is pressed, check the LED state variable and toggle the LED accordingly
  • Adding a wait code block for 2 seconds after setting pin 13 to HIGH keeps the LED on for 2 seconds after the button is pressed