Week 3 : Embedded Programming

Programs

Individual Project

This week, I used Wokwi to simulate an LED fading effect on an ESP32 board. The code and demo are below:

LED Blink https://wokwi.com/projects/414283270734035969

int led = 18;         // the PWM pin the LED is attached to
int brightness = 0;   // how bright the LED is
int fadeAmount = 5;   // how many points to fade the LED by

// the setup routine runs once when you press reset:
void setup() {
  pinMode(led, OUTPUT); // declare pin 9 to be an output
}

// the loop routine runs over and over again forever:
void loop() {
  analogWrite(led, brightness); // set the brightness of pin 9

  brightness = brightness + fadeAmount; // change the brightness

  // reverse the direction of fading at the ends of the fade
  if (brightness <= 0 || brightness >= 255) {
    fadeAmount = -fadeAmount;
  }
  delay(10); // wait for 30 milliseconds to see the dimming effect
}
            

Group Assignment

Demonstrate and compare the toolchains and development workflows for alternative embedded architectures.

We learned about different boards and protocols used in microcontroller communication:

SWD is an ARM-specific protocol designed for micro debugging.

Group Assignment