Learn about embedded programming and create a basic program
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.
Before diving into my components, I learned about:
I tested three main components:
Testing the LED and buzzer circuits
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 in the serial monitor