const int sensorPin = A0;
const int ledPins[4] = {2, 4, 6, 8}; // Updated LED pin numbers
void setup() {
Serial.begin(9600);
for (int i = 0; i < 4; i++) {
pinMode(ledPins[i], OUTPUT);
}
}
void loop() {
int moisture = analogRead(sensorPin);
Serial.print("Moisture Level: ");
Serial.println(moisture);
int ledCount = map(moisture, 400, 750, 0, 4); // Adjust range based on sensor readings
ledCount = constrain(ledCount, 0, 4); // Ensure value stays between 0 and 4
for (int i = 0; i < 4; i++) {
if (i < ledCount) {
digitalWrite(ledPins[i], HIGH);
} else {
digitalWrite(ledPins[i], LOW);
}
}
delay(1000);
}
We created a new code (made by the one and only oliver choi) that displays messages in the Serial Monitor so that it is easy to know when the pump system is activated and when the pump is on/off.
Friday - Incorporate OC's feedback, strap a rubber band to the gear and the wooden piece, Laser cut the rooftops and the retainer.
Sat&Sun - Final Assembly, Finish slides
Monday - Final Assembly, Finish slides (If not done), final polish
Tuesday - Presentation