24 lines
500 B
C++
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
|
|
} |