19 lines
485 B
C++
19 lines
485 B
C++
#include <Arduino.h>
|
|
|
|
void setup() {
|
|
// Initialize serial communication at 9600 baud
|
|
Serial.begin(9600);
|
|
}
|
|
|
|
void loop() {
|
|
// Simulate a temperature reading (replace with actual sensor logic if needed)
|
|
float temperature = 25.5; // Example value in Celsius
|
|
|
|
// Print the temperature message to the serial monitor
|
|
Serial.print("Temperature: ");
|
|
Serial.print(temperature);
|
|
Serial.println(" °C");
|
|
|
|
// Wait for 5 seconds before sending the next message
|
|
delay(5000);
|
|
}
|