Week 3: Embedded Programming

Assignment

Learn about embedded programming and create a basic program

Project: Testing Final Project Components

I used this week to test out key components on Wokwi that I'll need for my fish feeder final project. I worked with LEDs, a buzzer, and a temperature sensor to understand the basics of embedded programming while testing actual parts I'll need later.

Understanding the Basics

Before diving into my components, I learned about:

Testing Components

I tested three main components:

Testing in Wokwi

Testing the LED and buzzer circuits

Code

Here's my test code for the components:


#include 

#define LED_PIN 13
#define BUZZER_PIN 12
#define TEMP_PIN 2
#define DHTTYPE DHT11

DHT dht(TEMP_PIN, DHTTYPE);

void setup() {
    Serial.begin(9600);
    pinMode(LED_PIN, OUTPUT);
    pinMode(BUZZER_PIN, OUTPUT);
    dht.begin();
}

void loop() {
    // Test LED
    digitalWrite(LED_PIN, HIGH);
    delay(1000);
    digitalWrite(LED_PIN, LOW);
    
    // Test Buzzer
    tone(BUZZER_PIN, 1000);
    delay(500);
    noTone(BUZZER_PIN);
    
    // Test Temperature Sensor
    float temp = dht.readTemperature();
    Serial.print("Temperature: ");
    Serial.println(temp);
    
    delay(2000);
}
    
Temperature Readings

Temperature readings in the serial monitor

What I Learned

← Back to main page