--- /dev/null
+.DS_Store
+bin/*/
+*build-*
+*build*
+*~
+build-tmp/
+doc/
+debug.txt
+.ycm_extra_conf.pyc
+.ropeproject
+*.swp
--- /dev/null
+
+void setup() {
+}
+
+void loop() {
+}
--- /dev/null
+../Makefile.global
\ No newline at end of file
--- /dev/null
+Part 1 - SPI I/O Expander (15 points)
+
+Build a circuit and write code so that pressing a pushbutton turns on an external LED through the I/O port expander
+
+ Releasing the button should turn the LED off.
+ The button and external LED must both be connected to the port expander
+ The ESP32-C6 should only be connected to the port expander via SPI
+
--- /dev/null
+# Add libraries you want to install here.
+# Run `make pkginst` to download all the necessary packages.
+Goldelox-Serial-Arduino-Library
+Adafruit MCP23017 Arduino Library
--- /dev/null
+
+void setup() {
+}
+
+void loop() {
+}
--- /dev/null
+../Makefile.global
\ No newline at end of file
--- /dev/null
+Part 2 - I2C IMU (15 points)
+
+Build a circuit and write code so that tilting/moving the IMU in different directions turns on different colors of the on board RGB LED
+
+ Tilting forwards and backwards should result in 2 different colors
+ Tilting sideways (left and right) should result in 2 different colors
+ Moving the board up and down should result in 2 different colors
+
--- /dev/null
+
+void setup() {
+}
+
+void loop() {
+}
--- /dev/null
+../Makefile.global
\ No newline at end of file
--- /dev/null
+Part 3 - I2C DAC (10 points)
+
+Build a circuit and write code so that the DAC generates a Sine Wave, demonstrate the Sine Wave on the Oscilloscope and show to to a TA
--- /dev/null
+
+void setup() {
+}
+
+void loop() {
+}
--- /dev/null
+../Makefile.global
\ No newline at end of file
--- /dev/null
+Part 4 - Serial uLCD W/Nav Switch (10 points)
+
+Build a circuit and write code so that you can move a ball on the uLCD peripheral with the digital Nav Switch from Lab 1
+
+ Use your code from Lab 1 as a starting point
+ The ball should not be able to move out of bounds from the screen
+ It must also move diagonally
+
--- /dev/null
+
+void setup() {
+}
+
+void loop() {
+}
--- /dev/null
+../Makefile.global
\ No newline at end of file
--- /dev/null
+Part 5 - uLCD W/IMU (15 points)
+
+Build a circuit and write code so that you can change the velocity of the ball by tilting the IMU forwards/backwards or sideways
+
+ Ensure that the ball maintains its current velocity when the circuit is standing still
+ Tilting the board should start to change the balls velocity (in that direction)
+ When the ball hits the edge of the screen, it should change colors
+
+Part 5.5 - Replace Ball with Text (10 points, Extra Credit)
+
+Building upon part 5, replace the ball with text that says which direction it is going
+
+ It should work for all 4 directions, along with the 4 diagonal directions as well
+ Up, Down, Right, Left
+ Up-left, Up-right, Down-left, Down-right
+
--- /dev/null
+
+void setup() {
+}
+
+void loop() {
+}
--- /dev/null
+../Makefile.global
\ No newline at end of file
--- /dev/null
+Part 6 - I2C Capacitive Keypad (10 points)
+
+Build a circuit and write code so that you can use the capacitive keypad to display the number pressed to the serial monitor
+
+ Each keypad press should be distinct on the serial monitor
+
--- /dev/null
+
+void setup() {
+}
+
+void loop() {
+}
--- /dev/null
+../Makefile.global
\ No newline at end of file
--- /dev/null
+Part 7 - Making a Secure Phone Lock Screen (25 points, +5 points Extra Credit)
+
+Build a circuit and write code so that you emulate a Phone Lock Screen with the uLCD, the Capactive Keypad, and the IMU
+
+ Your passcode should be your ESP32 board number (in 4 digits so 32 would be 0032)
+ Digits 0-9 should be 0-9, 10 should be enter passcode, 11 should be delete previous number
+ You must have 3 distinct tilt directions for the second part of the passcode (something like forward, backwards, left)
+ You should display to the screen in red text that the phone is locked and then green when it is unlocked
+ You should also display on the screen what the user has input so far (both numbers, and directions - text works, +5 points Extra Credit for drawing Arrows)
+ The capacitive keypad and the IMU should be connected on the same I2C bus. There should only be one I2C wire your code.
+
--- /dev/null
+
+void setup() {
+}
+
+void loop() {
+}
--- /dev/null
+../Makefile.global
\ No newline at end of file
--- /dev/null
+Part 7.5 - Hacking Diego's ESP32 (20 points, Extra Credit) - WORK IN PROGRESS READY ON 9/16
+
+Build a circuit and write code so you can serially connect your ESP32 to my ESP32 and unlock the screen on mine by finding the random passcode.
+
+ My passcode resets to a random number every 30 minutes on my board (and unplugging it resets the passcode too!!)
+ The passcode can be found by examining the SPI data sent out on the pins
+ The ESP32 can be found in the lab room with a label on it indicating so
+ You should use your Capacitive Keypad to input the code to your ESP32, have your ESP32 send the code over serially to my ESP32 to have it access my lock screen
+ Your Capacitive Keypad should behave the same as part 7, no IMU needed to unlock this time around!
+
--- /dev/null
+#!/usr/bin/make
+
+# Global Makefile is symlinked in each individual project!
+PYTHON:=/usr/bin/python3
+SHELL:=/bin/sh
+
+all: build
+ arduino-cli upload -p $(ESP32_PORT) --fqbn esp32:esp32:esp32c6 .
+
+build:
+ arduino-cli compile --fqbn esp32:esp32:esp32c6 .
+
+setport:
+ $(PYTHON) ../scripts/select_board.py
+
+setup:
+ $(SHELL) ../scripts/setup_arduino_cli.sh
+
+pkginst:
+ $(SHELL) ../scripts/pkginst.sh libs.txt
--- /dev/null
+#!/bin/sh
+
+# Arduino CLI package installation
+
+cat $1 | sed 's/#.*//' | tr '\n' '\0' | xargs -0 arduino-cli lib install
--- /dev/null
+#!/usr/bin/python3
+
+import getopt
+import json
+import subprocess
+import sys
+import shlex
+import shutil
+
+def main(argv):
+ cond = False
+ optlist, args = getopt.getopt(argv[1:], "a")
+ for i in optlist:
+ if i[0] == "-a":
+ cond = True
+
+ # get arduino-cli output
+ loc = shutil.which("arduino-cli");
+ if loc is None:
+ raise FileNotFoundError("arduino-cli is not installed!")
+
+ js = json.loads(subprocess.getoutput(loc + " board list --json"))
+ i = 0;
+ l = []
+ print("Select a board:", file=sys.stderr)
+ for ent in js["detected_ports"]:
+ if "matching_boards" in ent:
+ print("%d\t%s" % (i, ent["matching_boards"][0]["name"]),
+ file=sys.stderr);
+ l.append(ent);
+ i += 1
+ elif cond:
+ print("%d\t%s on %s" % (i,
+ ent["port"]["protocol_label"], ent["port"]["address"]),
+ file=sys.stderr);
+ l.append(ent);
+ i += 1
+
+ i = -1;
+ while i < 0 or i >= len(l):
+ print("? ", end="", file=sys.stderr)
+ x = input();
+ if (not x.isdigit()):
+ print("The number must be numeric", file=sys.stderr)
+ continue
+ i = int(x);
+ print("Copy-paste the below line:", file=sys.stderr);
+ print("export ESP32_PORT=%s" % shlex.quote(l[i]["port"]["address"]))
+
+
+if __name__ == "__main__":
+ main(sys.argv)
+
--- /dev/null
+#!/bin/bash
+
+set -e
+
+arduino-cli config init
+arduino-cli core update-index
+arduino-cli core install esp32:esp32
+