Skip to content

Commit

Permalink
Test incorporation of Message to Temp Change
Browse files Browse the repository at this point in the history
  • Loading branch information
Firewirer committed Apr 10, 2021
1 parent afcd485 commit 1c36b0c
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 86 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.10)

# set the project name
project(Tsic)
project(Trashbot)

file(GLOB INCLUDE CONFIGURE_DEPENDS
"include/messaging/*.h"
Expand All @@ -11,12 +11,12 @@ file(GLOB CPP CONFIGURE_DEPENDS "lib/*.cpp")


# add the executable
add_executable(Tsic
add_executable(Trashbot
${CPP}
${INCLUDE}
)

target_link_libraries(Tsic
target_link_libraries(Trashbot
pigpio
crypto
boost_iostreams
Expand Down
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,37 @@ More documentation about `gui` can be found [here](./gui)
To get the project up and running by yourself, follow these steps:
### Prerequisites

GUI Prerequisites:

`apt-get install qtdeclarative5-dev-tools`

`apt-get install libqcustomplot-dev`

Email Messaging Prerequisites:

`sudo apt-get install libssl-dev`

`sudo apt-get install libboost-all-dev`

Temp Sensor Prerequisites:

`sudo apt-get install `


### Installation
sudo apt-get install libssl-dev
sudo apt-get install libboost-dev

Run Cmake within directory:

`cmake .`

Run Make:

`make`

Run Program:

`sudo ./Trashbot`



## Roadmap
Expand Down
1 change: 1 addition & 0 deletions include/GPIO/TempDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class TempDetector {
bool* valid2;
Messaging* messaging;
bool* message1Sent;
bool* message2Sent;
private:

};
Expand Down
18 changes: 15 additions & 3 deletions lib/TempDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

using namespace std;

static const double THRESHOLD = 0.5;
static const double THRESHOLD1 = 1.0;
static const double THRESHOLD2 = 4.0;


TempDetector::TempDetector(Messaging* _messaging) {
messaging = _messaging;
Expand All @@ -15,7 +17,9 @@ TempDetector::TempDetector(Messaging* _messaging) {
valid1 = (bool *)(malloc(sizeof(bool)));
valid2 = (bool *)(malloc(sizeof(bool)));
message1Sent = (bool *)(malloc(sizeof(bool)));
message2Sent = (bool *)(malloc(sizeof(bool)));
*message1Sent = false;
*message2Sent = false;
}

TempDetector::~TempDetector() {
Expand All @@ -28,13 +32,21 @@ TempDetector::~TempDetector() {

void TempDetector::callBack(){
if (*valid1 && *valid2){
if ((*temp1 - *temp2) > 1.0 && not *message1Sent){
if ((*temp1 - *temp2) > THRESHOLD1 && not *message1Sent){
messaging->sendMessage1();
*message1Sent = true;
}
if ((*temp1 - *temp2)< 0.5 && *message1Sent){
if ((*temp1 - *temp2)< (THRESHOLD1 - 0.5) && *message1Sent){
*message1Sent = false;
}

if ((*temp1 - *temp2) > THRESHOLD2 && not *message2Sent){
messaging->sendMessage2();
*message2Sent = true;
}
if ((*temp1 - *temp2)< (THRESHOLD2 - 0.5) && *message2Sent){
*message2Sent = false;
}
}


Expand Down
47 changes: 0 additions & 47 deletions message/Messaging.cpp

This file was deleted.

31 changes: 0 additions & 31 deletions message/sendmail.cpp

This file was deleted.

0 comments on commit 1c36b0c

Please sign in to comment.