Skip to content

Commit

Permalink
Merge pull request #45 from aleemont1/davide
Browse files Browse the repository at this point in the history
Davide
  • Loading branch information
davidedimarco00 authored Feb 13, 2024
2 parents cfa1418 + 31bded4 commit 0e0e9ca
Show file tree
Hide file tree
Showing 47 changed files with 1,577 additions and 862 deletions.
2 changes: 1 addition & 1 deletion river-monitoring-dashboard/river-monitoring-dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ def update_status_display(n):
return f'Stato del sistema: {data_queue[-1]["status"]}'

if __name__ == "__main__":
app.run_server(debug=True, port=8053)
app.run_server(debug=True, port=8055)
1 change: 1 addition & 0 deletions water-channel-controller/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ lib_deps =
marcoschwartz/LiquidCrystal_I2C@^1.1.4
arduino-libraries/Servo@^1.2.1
nabontra/[email protected]+sha.2bf7fb3c17
paulstoffregen/TimerOne@^1.1.1
14 changes: 14 additions & 0 deletions water-channel-controller/src/Config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef __CONFIG__
#define __CONFIG__
#define __DEBUG__

#include "Arduino.h"

constexpr int BASE_PERIOD = 100;
constexpr int POT_PIN = A0;
constexpr int BUTTON_PIN = 4;
constexpr long TIME_OUT_CONNECTION = 300000L;
constexpr int SERVO_PIN = 9;
constexpr int TIME_TO_MOVE = 20;

#endif // __CONFIG__
37 changes: 37 additions & 0 deletions water-channel-controller/src/WaterChannelController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#ifndef __WATERCHANNELCONTROLLER__
#define __WATERCHANNELCONTROLLER__

#include "Arduino.h"

/**
* @brief Enum for the modes of the water channel controller.
*
* This enum represents the possible modes of the water channel controller: Automatic and Manual.
*/
enum class Mode
{
AUTOMATIC,
MANUAL,
ALARM_TOO_LOW,
NORMAL,
PRE_ALARM_TOO_HIGH,
ALARM_TOO_HIGH,
ALARM_TOO_HIGH_CRITIC
};

/**
* @brief A controller for a water channel.
*
* This class represents a controller for a water channel. The controller can be in one of two modes: Automatic or Manual.
* The controller has an active position and flags to indicate whether the communication or position has changed.
*/
class WaterChannelController
{
public:
bool commChange; ///< Flag to indicate whether the communication has changed.
bool posChange; ///< Flag to indicate whether the position has changed.
Mode activeMode; ///< The active mode of the controller.
unsigned int activePosition; ///< The active position of the controller.
};

#endif // __WATERCHANNELCONTROLLER__
13 changes: 0 additions & 13 deletions water-channel-controller/src/WaterChannelController/State.h

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0e0e9ca

Please sign in to comment.