### Agenda:
Make sure you can talk to your MCU! Follow [these instructions](https://randomnerdtutorials.com/installing-esp32-arduino-ide-2-0/)
- Open Arduino IDE
- Plug in your microcontroller (ask if you need a cable)
- Go to Tools > Board > ESP32 Arduino > select XIAO_ESP32C3
- Dropdown menu, "Select other board and port", select your MCU
- Open File > Examples > Basics > AnalogReadSerial
- Upload the file, touch pin A0, confirm it responds to touch
- Bookmark the [pin mapping](https://forum.seeedstudio.com/uploads/default/original/2X/9/96d54945575d63e62df19a60f4c47e3048c6f5ce.png)
3:15: Introductions / Assignment Review
3:40: Overview of Electronics basics
4:15: Use the L9110 H Bridge Power Driver to drive a motor. Write a new function to give the motor commands.
4:45: Break
5:00: Workshop on microcontroller programming, (conditional statements, loops, pullup resistors).
### Labs:
Use the Electronics basics page and its links.
See Lab slides on programming fundamentals.
- 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, [circuit-diagram.org](https://www.circuit-diagram.org/), [EasyEDA](https://easyeda.com/), 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.
- Use a hand sketch, [circuit-diagram.org](https://www.circuit-diagram.org/), [EasyEDA](https://easyeda.com/), or other.
- Bring your circuit to class 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.