i chose the xiao-esp32-c3 for this week. i wanted to practice programming the xiao, as i understand its small size makes it a prime candidate for pcbs in compact spaces. this makes me think it would be suitable for my final project because i will have to fit a microcontroller in the base of a candle holder, which means the electronic component of my final project needs to be pretty compact.
i watched this youtube video to get a better understanding of what the xiao does, and this youtube video to learn more about programming basics. admittedly i didn’t find the second youtube video super helpful or applicable but i love crash course so
i took a look at this pinout (below), this this overview , and the datasheet. the overview and the datasheet have a ton of overlapping material, but the overview from seeed studio was easier to comprehend and came with some helpful start-up tutorials!
i want to see if a xiao count time and turn on an led after a certain amount of time has elapsed. for this project, i had an led turn on after 5 seconds had elapsed. i think this could be potentially helpful in my final project, where i want leds to represent time elapsed
i used the code that came with the xiao-esp32-c3 and consulted chatgpt and debugged until it worked.
// Define the LED pins
const int ledPins[] = {D2, D3, D4}; // Change these to your actual LED pins
const int numLEDs = sizeof(ledPins) / sizeof(ledPins[0]);
// Variables to track time
unsigned long previousMillis = 0;
const unsigned long interval = 5000; // 5 seconds in milliseconds
int turnOnCount = 0; // To track how many times LEDs turned on
void setup() {
Serial.begin(115200);
// Initialize all LED pins as OUTPUT and turn them off
for (int i = 0; i < numLEDs; i++) {
pinMode(ledPins[i], OUTPUT);
digitalWrite(ledPins[i], LOW);
}
Serial.println("Setup complete");
}
void loop() {
unsigned long currentMillis = millis();
// Check if it's time to turn on the LEDs
if (currentMillis - previousMillis >= interval && turnOnCount < numLEDs) {
previousMillis = currentMillis;
// Turn on the current LED
Serial.print("Turning on LED ");
Serial.println(ledPins[turnOnCount]);
digitalWrite(ledPins[turnOnCount], HIGH);
// Increment to the next LED
turnOnCount++;
}
}
this is helpful, as it demonstrates that the xiao-esp32-c3 can accurately count time. however, in my final project, i want to use a strip of addressable leds as opposed to leds connected to individual pins. wowki has an addressable strip option (the neopixel ring (ws2812)). i tried code that i know works with addressable strips and esp32s, consulted other projects to double check my wiring, yet i couldn’t get the ring to even turn on. there are no error messages so for now i will keep trying new snippets.
for this week, i compared the tool chain and development workflow for the embedded ai LiteRT and silicon compiler.
for the tool chain: siliconcompiler is a translator of sorts and LiteRT runs machine learning on microcontrollers. upon initial investigation of their websites, i frankly had a lot of trouble discerning what the precise difference was in toolchains (where to find it, how to make sense of it, etc), due to my lack of understanding of programming in general. looking forward to following up on this question in office hours and further improving upon my understanding.
for the development workflow: it appears that the silicon compiler uses a workflow with a lot of two-way communication, with the silicon compiler interfacing with tools, drivers, and process design kits. on the other hand, the LiteRT trains a model then runs interference on a c++ device to process the results.