smart_garden/src/main.cpp
2020-06-23 12:22:17 +02:00

24 lines
500 B
C++

/*
Main file for the SmartGarden project
*/
#include <header.h>
void setup() {
Serial.begin(9600);
setupCapacitiveSoilMoistureSensor();
setupLightSensor();
}
void loop() {
uint16_t lxValue = readLightSensorValue();
Serial.print("Light intensity: ");
Serial.print(lxValue);
Serial.println(" lx");
uint16_t mstValue = loopCapacitiveSoilMoistureSensor();
Serial.print("Soil moisture: ");
Serial.println(mstValue);
delay(200); // delay in between reads for stability
}