Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions src/Devices/Serial_TC.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
// This class is for the Serial Commands used in Tank Controller.
// Serial here mostly deals with writing or printing data over through the serial port.
// Serial.print and Serial.write can be called in different ways to print data.
// Also print_PID, print_DataTime, print_mac are used to print the PID information, current date information, and the
// mac address.

/**
* This class is for the Serial Commands used in Tank Controller.
* Serial here mostly deals with writing or printing data over through the serial port.
* Serial.print and Serial.write can be called in different ways to print data.
* Also print_PID, print_DataTime, print_mac are used to print the PID information,
* current date information, and the mac address.
*/
#include <Arduino.h>
#include <RTClib.h>

class Serial_TC {
private:
void print_two_digits(int value) {
if (value < 10) {
Serial.print('0');
}
Serial.print(value, DEC);
}

public:
Serial_TC() {
Serial.begin(9600);
}

/**
* Print the PID.
*/
void print_PID(double Kp, double Ki, double Kd, double output) {
Serial.print(F("Kp:"));
Serial.print(Kp);
Expand All @@ -25,12 +36,6 @@ class Serial_TC {
Serial.println(output / 1000, 1);
}

void print_two_digits(int value) {
if (value < 10) {
Serial.print('0');
}
Serial.print(value, DEC);
}
void print_DateTime(DateTime dateTime) {
Serial.print(dateTime.year(), DEC);
Serial.print('-');
Expand Down
9 changes: 3 additions & 6 deletions src/UIState/MainMenu.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/*
* MainMenu.cpp
*
* Branch to other states to handle various menu options
*/

// #include "CalibrationManagement.h"
// #include "ChangeGoogleSheetInterval.h"
// #include "ChangeTankID.h"
Expand All @@ -21,6 +15,9 @@
// #include "TemperatureCalibration.h"
#include "MainMenu.h"

/**
* Branch to other states to handle various menu options
*/
void MainMenu::handleKey(char key) {
switch (key) {
case 'A': // Change pH set_point
Expand Down
2 changes: 1 addition & 1 deletion src/UIState/MainMenu.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MainMenu.h
*
* Branch to other states to handle various menu options
Expand Down
3 changes: 1 addition & 2 deletions src/UIState/SetPHSetPoint.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/*
/**
* SetPHSetPoint.h
*
* Handle top-level menu option
*/

#pragma once
#include "UIState.h"

Expand Down
2 changes: 1 addition & 1 deletion src/UIState/UIState.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* Abstract superclass for the TankController UI states
* Concrete subclass for the initial (start) state
*/
Expand Down