From dbbde95ae72907b6f3ad4731ddcfdb8782b4035b Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Wed, 26 Feb 2025 13:39:31 +0100 Subject: add more mussels --- mussel3/mussel3.ino | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 mussel3/mussel3.ino (limited to 'mussel3') diff --git a/mussel3/mussel3.ino b/mussel3/mussel3.ino new file mode 100644 index 0000000..0777b01 --- /dev/null +++ b/mussel3/mussel3.ino @@ -0,0 +1,46 @@ +/// mussel3 - mussel voter influenced by Humidity +/// +/// SPDX-License-Identifier: GPL-3.0-or-later +/// SPDX-FileCopyrightText: 2025 Noor Ahmad + + +#include +#include + + +#define DHTPIN 15 // Digital pin connected to the DHT sensor - red +#define DHTTYPE DHT11 +#define ESC_SIGNAL_PIN 19 //white +DHT dht(DHTPIN, DHTTYPE); + + +void setup() { + Serial.begin(9600); + dht.begin(); +} + +void loop() { + // Wait a few seconds between measurements + delay(1000); + + vote(); + + + + delay(1000); // Delay between sensor readings +} +void vote() { + + float temperature = dht.readTemperature(); // Read temperature as Celsius + + // Print temperature + Serial.print("Temperature: "); + Serial.print(temperature); + Serial.println("°C"); + + int lightValue = analogRead(34); // GPIO34 (analog pin) - blue + + // Print the light sensor value to Serial Monitor + Serial.print("Light Sensor Value: "); + Serial.println(lightValue); +} \ No newline at end of file -- cgit v1.2.3