Week 12: Application/Interface programming

November 27th, 2023
Board with board

Background

For this week, we were asked to design, build, and connect wired or wireless node(s) with a network or bus addresses and a local interface.

Materials

  • ESP32-S3 Sense (pictured below)
  • USB-C connector cable
  • Analog joystick (w/ breakout board)
  • Reading the datasheet

    You already know what I'm going to say-- it's important to read the datasheet for any components that you're working with. This will help you understand the architecture and language you should use when attempting to communicate with the components various subparts in later programming steps.

    Hardware setup

    1. Press and hold the boot button (labeled 'B' in the bottom right of board) as you connect the ESP32-S3 to your PC with the USB-C cable.
    2. Pin diagram
    3. You should be able to see the device in your finder.
    4. Finder

    Software setup

    Once the hardware has been set up, we can move on to the software.

    1. Open the Arduino IDE
    2. Add Seeed Studio XIAO ESP32-S3 board package to the IDE by navigating to Arduino IDE > Settings and under 'Additional Boards Manager URLs' copy and paste:
      https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
    3. Install the latest version of the board package you just added by navigating to Tools > Board > Boards Manager and searching for "Arduino ESP32 Boards" and "esp32".
    4. Select your board and port so the IDE knows what pieces to connect together hardware-wise. Your board should be under Tools > Board and called "XIAO-ESP32S3".
    5. Upload the following code. This program will create a web server that you can connect to and will continuously update the readings from your sensor.

    Connecting input

    1. Connect joystick’s X and Y to A0 and A1, respectively
    2. Connect the XIAO’s 5V to joystick module’s VCC
    3. Connect the XIAO’s ground to the joystick’s ground
    Everything connected

    Final thoughts

    What did I learn? Lots of things! How to host a website, how to continuously update it, how to send styling information via client.println, how to debug your internet connection... the list goes on.

    I'm doing everything in my power to stay on top of school, and this week definitely threw me for a loop. After having some difficulty understanding the assignment at hand, I finally settled on my plan, but kept running into bugs with the Arduino IDE, a faulty XIAO, then wifi connectivity/permission issues with my internet provider at home.

    On top of all that, someone literally stole my development board and peripherals when I left my desk for a brief moment, so I'm missing photos of it working. I'm done with this week. Roast me, I don't care. There are just some weeks here that I'm learning a lot, but have nothing cool to show at the end. I'm just trying to survive, man.

    Everything is on fire