Skip to content
Snippets Groups Projects
Commit de0f8c7d authored by Pirahalathan Premachandran's avatar Pirahalathan Premachandran
Browse files

Flowerpot fertig

parent cae8c05c
No related branches found
No related tags found
No related merge requests found
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
......@@ -5,6 +5,10 @@
// TODO: Implement the constructor
Flowerpot::Flowerpot (int threshold, uint8_t displayAddress, int valvePin)
: threshold {threshold}, valvePin{valvePin}, moisture{0}, tickCount{0}, valvePos{0}, moistureSensor{displayAddress} {
}
// TODO: Uncomment the following code. begin(), loop(), observe(), and watering() are already implemented
......
// Flowerpot.h
#include <Servo.h>
#include "MoistureSensor.h"
// TODO: Declare the Flowerpot class according to the class diagram here
class Flowerpot {
public:
Flowerpot (int threshold, uint8_t displayAddress, int valvePin);
void begin ();
void loop ();
private:
enum ValveStates {S_OBSERVE, T_ENTERWATERING, S_WATERING, T_ENTEROBSERVE};
int threshold;
int valvePin;
int moisture;
int tickCount;
int valvePos;
uint8_t displayAddress;
ValveStates state;
MoistureSensor moistureSensor;
Servo valve;
void observe ();
void watering ();
};
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment