### Agenda:
Make sure you can talk to your microcontroller! If you want to use ESP32, follow [these instructions](https://randomnerdtutorials.com/installing-esp32-arduino-ide-2-0/).
1. Open Arduino IDE (install v. 1.8 and/or 2.0)
2. Plug in your microcontroller (ask if you need a cable)
3. Go to Tools > Board > *Uno/ESP32/etc.*
4. Find Tools > Port > *your microcontroller*
5. Open File > Examples > Basics > Blink
6. Upload the file
12:00: Website Review
12:30: Overview of Electronics basics
1:00: Workshop on microcontroller programming, (conditional statements, loops, pullup resistors).
1:45: Break
2:00: Use the L9110 H Bridge Power Driver to drive a motor. Write a new function to give the motor commands.
### Labs:
Use the Electronics basics page and its links.
- Use the multimeter in voltage, resistance, and continuity modes.
- Build a voltage divider circuit. Build a potentiometer circuit.
- Build and measure circuits with resistors in parallel and series.
- Practice drawing schematics. Use a hand sketch, [Flastad](https://www.falstad.com/circuit/), [circuit-diagram.org](https://www.circuit-diagram.org/), Fusion 360 (Eagle), or other.
Programming Fundamentals Workshop, conditional statements and loops, help with assignments.
### Assignment:
Program an Arduino board to do something. The examples in the Arduino Projects Book provide good starting points. You may also wish to use this assignment to build on the previous assignment.
- Include code snippets in your documentation.
- Draw a schematic of your circuit. Use a hand sketch, [Flastad](https://www.falstad.com/circuit/), Fusion 360 (Eagle), or other.
- Bring your circuit to class Tuesday and be ready to do a brief live demo.
Next week we will talk about 3D printing, and a bit more about 3D modeling. Take a moment to think about your final project proposal. Will it require 3D printed parts?
### Examples:
- [Mohammed's Butterfly](https://mohammed-mutaher.github.io/PHYSCI-70/04/index4.html)
- [Michael's Mechanism](https://mezhang2000.github.io/PHYSCI70/04/week_4.html)
- [Isa's Carousel](https://isaberliner.github.io/PHYSCI-70/04/index4.html)
- [PK's LEDs + Potentiometer](https://laurenbhr.github.io/PHYSCI-70/04_micro/index.html)
- [Kalos' Winch](https://ingenuitive.github.io/PHYSCI-70/week4.html)
### Reading:
Introduction to microcontrollers, conditional statements and loops, Arduino Foundations. Arduino: Digital Pins, Analog Input Pins, PWM, and Memory
Arduino Projects Book Chapters 1-3.
Resources:
Arduino Foundations
Language Reference: Discover the what each term of the Arduino code language means.
Variables: Understand how to define and use variables in a Sketch.
Functions: Learn how to define and use functions in a Sketch.