#include <LiquidCrystal_I2C.h>
#include <EEPROM.h>
// LCD setup
LiquidCrystal_I2C lcd(0x27, 20, 4);
//Lock icon
byte customChar[] = {
B01110,
B10001,
B10001,
B10001,
B11111,
B11011,
B11011,
B11111
};
// Define the relay pins
const int numSolenoids = 6;
const int relayPins[numSolenoids] = {22, 23, 24, 25, 26, 27};
int relayStates[numSolenoids] = {LOW, LOW, LOW, LOW, LOW, LOW};
const unsigned long bootloaderDuration = 2000;
const unsigned long wipeEEPROMDuration = 2000;
// Define the button pins
const int buttonUp = 12;
const int buttonDown = 13;
const int buttonSelect = 11;
const int Switch = 53; // Switch pin
// Global variables for menu handling
unsigned long buttonPressStartTime = 0;
bool inSecretMenuToggle = false;
int currentSolenoid = 0;
bool editMode = false;
int editItem = 0; // 0 for Offset, 1 for Duration
bool virtualSwitchState = false; // false means switch is OFF, true means ON
// Locking Global variables
unsigned long lastSwitchTime = 0;
int switchActivationCount = 0;
bool isLocked = false;
const unsigned long lockInterval = 5000; // 5 seconds
const int activationThreshold = 3; // Minimum activations within 5 seconds
//Secret menu variables
bool secretMenuActive = false;
int secretMenuPage = 1; // 1 for Simulation, 2 for Cleaning
int secretMenuPosition = 0; // 0 for ON, 1 for OFF
bool simulateOption = false;
bool cleaningOption = false;
unsigned long lastSecretMenuUpdate = 0;
unsigned long lastSimulationTime = 0; //We will see if i can finaly get it work
// Relay timing variables
unsigned long Offsets[numSolenoids];
unsigned long Durations[numSolenoids];
unsigned long maxInterval = 0;
// Define LCD update
volatile bool updateLCD = true;
enum menuTypes { STANDARD, SECRET } menuMode;
enum programTypes { NORMAL, SIMULATION } programMode;
class Timer {
// ... Timer class definition ...
private:
unsigned long startTime;
unsigned long interval;
bool running;
public:
Timer(unsigned long interval = 0) {
this->interval = interval;
running = false;
}
void start() {
startTime = millis();
running = true;
}
void stop() {
running = false;
}
bool isRunning() {
return running;
}
bool event() {
if (running && millis() - startTime >= interval) {
startTime = millis(); // reset the start time
return true;
}
return false;
}
};
class Delay {
// ... Delay class definition ...
private:
unsigned long startDTime;
unsigned long delayTime;
bool running;
public:
Delay(unsigned long delayTime = 0) {
this->delayTime = delayTime;
running = false;
}
void start() {
startDTime = millis();
running = true;
}
void stop() {
running = false;
}
bool isRunning() {
return running;
}
bool event() {
if (running && millis() - startDTime >= delayTime) {
startDTime = millis(); // reset the start time
return true;
}
return false;
}
};
Timer timers[numSolenoids];
Delay delays[numSolenoids];
void setup() {
// Begin serial communication
Serial.begin(9600);
// Start the hardware serial communication with Bluetooth
Serial1.begin(9600); // Use Serial1 for pins 18 (TX) and 19 (RX)
printlnBoth("Bluetooth communication started");
// Initialize the LCD
lcd.init();
lcd.backlight();
displayBootloader();
lcd.createChar(0, customChar);
// Initialize relay pins, button pins and load values from EEPROM
for (int i = 0; i < numSolenoids; i++) {
pinMode(relayPins[i], OUTPUT);
digitalWrite(relayPins[i], relayStates[i]);
}
// Set up the switch pin
pinMode(Switch, INPUT_PULLUP);
lastSwitchTime = millis();
// Set pullup on buttons
pinMode(buttonUp, INPUT_PULLUP);
pinMode(buttonDown, INPUT_PULLUP);
pinMode(buttonSelect, INPUT_PULLUP);
// Calculate, Load and print values from EEPROM
loadValuesFromEEPROM();
findMaxSolenoidTime();
printEEPROMValues();
printlnBoth("Changing menuMode to STANDARD");
menuMode = STANDARD;
printlnBoth("Changing programMode to NORMAL");
programMode = NORMAL;
delay(2000);
}
void loop() {
handleLocking();
menus();
functionality();
always();
//----------------will try simulate this way
findMaxSolenoidTime();
if (menuMode == SECRET && simulateOption) {
static unsigned long lastToggleTime = 0;
if (millis() - lastToggleTime >= maxInterval) {
lastToggleTime = millis();
virtualSwitchState = !virtualSwitchState; // Toggle the virtual switch state
simulateSwitchAction(virtualSwitchState);
}
}
}
template<typename T>
void printBoth(const T& data) {
Serial.print(data);
Serial1.print(data);
}
template<typename T>
void printlnBoth(const T& data) {
Serial.println(data);
Serial1.println(data);
}
void handleLocking() {
// Check for switch activation
if (digitalRead(Switch) == LOW) { // Assuming LOW when operated
if (millis() - lastSwitchTime > lockInterval) {
// More than 5 seconds since last activation, reset counter
switchActivationCount = 0;
}
lastSwitchTime = millis(); // Update the last switch activation time
switchActivationCount++; // Increment activation count
if (switchActivationCount >= activationThreshold) {
isLocked = true; // Lock the screen
printlnBoth("**** L O C K E D ****");
}
}
// Unlock the screen if the switch has not been activated for more than 5 seconds
if (millis() - lastSwitchTime > lockInterval && isLocked) {
isLocked = false;
printlnBoth("**** U N L O C K E D ****");
updateLCD= true;
// Optionally, you can update the standard screen here if needed
// updateStandardScreen();
}
// Display the lock screen if the system is locked
if (isLocked) {
lockedScreen(); // Function to handle lock screen display
}
}
//---test
void findMaxSolenoidTime() {
maxInterval = 0;
for (int i = 0; i < numSolenoids; i++) {
unsigned long totalTime = Offsets[i] + Durations[i];
if (totalTime > maxInterval) {
maxInterval = totalTime;
}
}
return maxInterval;
}
//---tes end
void menus() {
// ... Menu handling logic ...
switch (menuMode) {
case STANDARD:
handleStandardMenu();
break;
case SECRET:
handleSecretMenu();
break;
}
}
void functionality() {
// ... Functionality handling logic ...
if (programMode == NORMAL) {
//printlnBoth("Changing menuMode to SANDARD in functionality"); <<---THE FUCKING CULPRIT ALL ALONG.....
//menuMode = STANDARD;
handleNormalCode();
} else if (programMode == SIMULATION) {
handleSimulationCode();
}
}
void always() {
handleSerial();
handleButtons();
handleLCD();
// Check for simultaneous button press
if (digitalRead(buttonUp) == LOW && digitalRead(buttonDown) == LOW) {
if (!inSecretMenuToggle) {
// Start timing the button press
buttonPressStartTime = millis();
inSecretMenuToggle = true;
} else if (millis() - buttonPressStartTime > 1000) { // 1 second hold
// Toggle between STANDARD and SECRET menus
menuMode = (menuMode == STANDARD) ? SECRET : STANDARD;
inSecretMenuToggle = false; // Reset the toggle state
}
} else {
inSecretMenuToggle = false;
}
// Lock and Unlock Mechanism
}
void handleStandardMenu() {
if(updateLCD){
updateLCDContent();
}
}
void handleSecretMenu() {
if (!secretMenuActive) {
secretMenuActive = true;
lcd.clear();
lcd.setCursor(2, 0);
lcd.print("* Secret Menu *");
delay(1000);
menuMode = SECRET;
updateLCD = true;
}
}
void handleNormalCode() {
// ... Normal operation logic ...
static bool switchPressed = false;
if (digitalRead(Switch) == LOW) {
if (!switchPressed) { // Trigger only on the edge
switchPressed = true;
startRelaySequence();
}
} else {
switchPressed = false;
}
updateRelays();
}
//-------------------new functrion to try virtual switch
void simulateSwitchAction(bool state) {
if (state) {
// Logic to handle switch ON
startRelaySequence();
} else {
// Logic to handle switch OFF
}
updateRelays();
}
//--------------------------
void handleSimulationCode() {
// ... Normal operation logic ...
static bool switchPressed = false;
if (digitalRead(Switch) == LOW) {
if (!switchPressed) { // Trigger only on the edge
switchPressed = true;
startRelaySequence();
}
} else {
switchPressed = false;
}
updateRelays();
}
void startCleaning() {
// Open all relays
for (int i = 0; i < numSolenoids; i++) {
relayStates[i] = HIGH;
digitalWrite(relayPins[i], HIGH);
}
//updateLCD = true; // Set the flag to update the LCD
}
void stopCleaning() {
// Add logic to stop the cleaning
for (int i = 0; i < numSolenoids; i++) {
relayStates[i] = LOW;
digitalWrite(relayPins[i], relayStates[i]);
}
cleaningOption = false;
//updateLCD = true; // Set the flag to update the LCD
//printlnBoth("Cleaning mode stopped. Returning to normal state.");
}
void handleSerial() {
// Handle commands from the regular Serial
if (Serial.available() > 0) {
String command = Serial.readStringUntil('\n');
processCommand(command);
}
// Handle commands from the Bluetooth Serial (Serial1)
if (Serial1.available() > 0) {
String command = Serial1.readStringUntil('\n');
processCommand(command);
}
}
void processCommand(String command) {
command.trim(); // Remove any whitespace
if (command == "menu") {
// Enter Secret Menu
handleSecretMenu();
secretMenuActive = true;
updateLCD = true;
} else if (command == "exit") {
// Exit Secret Menu
menuMode = STANDARD;
secretMenuActive = false;
updateLCD = true;
} else if (command == "help") {
displayHelp();
} else if (command == "DEFAULT") {
setDefaultValues();
} else if (command == "ZERO") {
resetEEPROMValues();
} else if (command == "EEPROM RESET") {
resetEEPROMValues();
} else if (command == "Print") {
printEEPROMValues();
} else if (command == "bt") {
printBTdata();
} else if (command == "Info") {
printBuildInfo();
}// New command to set solenoid values
else if (command.indexOf('/') != -1) { // Check if the command contains '/'
int firstSlashIndex = command.indexOf('/');
int lastSlashIndex = command.lastIndexOf('/');
if (firstSlashIndex != lastSlashIndex) {
int solenoid = command.substring(0, firstSlashIndex).toInt();
int offset = command.substring(firstSlashIndex + 1, lastSlashIndex).toInt() * 10;
int opening = command.substring(lastSlashIndex + 1).toInt() *10 ;
if (solenoid > 0 && solenoid <= numSolenoids) {
Offsets[solenoid - 1] = offset;
Durations[solenoid - 1] = opening;
saveValuesToEEPROM();
printlnBoth("Solenoid " + String(solenoid) + " updated: Offset = " + String(offset) + ", Opening = " + String(opening));
updateLCD = true;
} else {
printlnBoth("Invalid solenoid number.");
}
} else {
printlnBoth("Invalid command format.");
}
} else if (command == "sim") {
// Navigate to the secret menu and simulation screen
menuMode = SECRET;
secretMenuPage = 1; // page 1 is for Simulation
secretMenuPosition = 1; //position 1 is "ON"
simulateOption = true; // Set the simulation option to true
programMode = SIMULATION; // Activate simulation mode
// Optionally update the display if needed
updateLCD = true;
handleSecretMenu();
printlnBoth("---Start Simulation");
} else if (command == "stop sim") {
// Navigate to the secret menu and simulation screen
menuMode = SECRET;
secretMenuPage = 1; // Assuming page 1 is for Simulation
secretMenuPosition = 0; // 0 is "OFF"
simulateOption = false; // Set the simulation option to true
programMode = NORMAL; // Activate simulation mode
// Optionally update the display if needed
updateLCD = true;
handleSecretMenu();
printlnBoth("---Stop Simulation");
} else if (command == "clean") {
printlnBoth("---Start Cleaning");
startCleaning();
} else if (command == "stop clean") {
printlnBoth("---Stop Cleaning");
stopCleaning();
}
}
void handleButtons() {
//printBoth("Current menuMode in handleButtons: ");
//printlnBoth(menuMode == SECRET ? "SECRET" : "STANDARD"); FOR DEBUGING
//delay(2000);
if (isLocked) {
return;
}
// Check if we are in the secret menu
if (menuMode == SECRET) {
// Handle buttons specifically for SECRET menu
if (digitalRead(buttonSelect) == LOW) {
//printlnBoth("SECRET Menu: Select Pressed");
// Logic for Select button in SECRET menu
secretMenuPosition = !secretMenuPosition; // Toggle ON/OFF option
updateLCD = true;
delay(300); // debounce delay
} else if (digitalRead(buttonUp) == LOW) {
// Logic for UP button in SECRET menu
secretMenuPage = max(1, secretMenuPage - 1); // Decrease page number, minimum is 1
updateLCD = true;
delay(200); // debounce delay
} else if (digitalRead(buttonDown) == LOW) {
// Logic for DOWN button in SECRET menu
secretMenuPage = min(2, secretMenuPage + 1); // Increase page number, maximum is 2 (or more if you have more pages)
updateLCD = true;
delay(200); // debounce delay
}
// Additional logic based on secretMenuPage and secretMenuPosition
if (secretMenuPage == 1) {
simulateOption = (secretMenuPosition == 1);
if (simulateOption) {
programMode = SIMULATION;
} else {
programMode = NORMAL;
}
} else if (secretMenuPage == 2) {
cleaningOption = (secretMenuPosition == 1);
if (cleaningOption) {
startCleaning();
} else {
stopCleaning();
}
}
} else if (menuMode == STANDARD) {
// Handle buttons for STANDARD menu
if (digitalRead(buttonUp) == LOW) {
//printlnBoth("Standard Menu: Up Pressed");
if (editMode) {
if (editItem == 0)
Offsets[currentSolenoid] = (Offsets[currentSolenoid] + 10) % 1010; // Roll over at 100
else if (editItem == 1)
Durations[currentSolenoid] = (Durations[currentSolenoid] + 10) % 1010; // Roll over at 100
} else {
currentSolenoid = (currentSolenoid + 1) % numSolenoids;
}
updateLCD = true;
delay(200); // debounce delay
}
if (digitalRead(buttonDown) == LOW) {
//printlnBoth("Standard Menu: Down Pressed");
if (editMode) {
if (editItem == 0) { // Offset
if (Offsets[currentSolenoid] > 0) {
Offsets[currentSolenoid] -= 10;
} else {
Offsets[currentSolenoid] = 1000; // Roll over to 100
}
} else if (editItem == 1) { // Opening
if (Durations[currentSolenoid] > 0) {
Durations[currentSolenoid] -= 10;
} else {
Durations[currentSolenoid] = 1000; // Roll over to 100
}
}
}
else {
currentSolenoid = (currentSolenoid - 1 + numSolenoids) % numSolenoids;
}
updateLCD = true;
delay(200); // debounce delay
}
if (digitalRead(buttonSelect) == LOW) {
//printlnBoth("Standard Menu: Select Pressed");
if (editMode) {
editItem = (editItem + 1) % 2;
if (editItem == 0) {
saveValuesToEEPROM();
displaySavedMessage();
delay(1000); // Display saved message briefly
editMode = false;
}
} else {
editMode = true;
}
updateLCD = true;
delay(300); // debounce delay
}
}
}
void handleLCD() {
// ... LCD update handling ...
if (updateLCD) {
updateLCDContent();
updateLCD = false; // Reset the flag after updating
}
}
void updateLCDContent() {
// ... LCD content update logic ...
lcd.clear();
//--------------------------------------if secret menu
if (menuMode == SECRET) {
if (millis() - lastSecretMenuUpdate > 500) { // Update every 500 ms
lcd.clear();
if (secretMenuPage == 1) {
lcd.setCursor(5, 0);
lcd.print("Simulation");
lcd.setCursor(2, 2);
lcd.print(secretMenuPosition == 1 ? "<< ON >> OFF " : " ON << OFF >>");
} else if (secretMenuPage == 2) {
lcd.setCursor(6, 0);
lcd.print("Cleaning");
lcd.setCursor(2, 2);
lcd.print(secretMenuPosition == 1 ? "<< ON >> OFF " : " ON << OFF >>");
}
lastSecretMenuUpdate = millis();
}
}
//----------------------------------------------------
//--------------------------------------if normal menu
if (menuMode == STANDARD) {
lcd.clear();
lcd.setCursor(5, 0);
lcd.print("Solenoid ");
lcd.print(currentSolenoid + 1);
lcd.setCursor(0, 1);
lcd.print("Offset : ");
if (editMode && editItem == 0) {
lcd.print("<< ");
lcd.print(Offsets[currentSolenoid] / 10);
lcd.print(" >> %");
} else {
lcd.print(Offsets[currentSolenoid] / 10);
lcd.print(" %");
}
lcd.setCursor(0, 2);
lcd.print("Opening: ");
if (editMode && editItem == 1) {
lcd.print("<< ");
lcd.print(Durations[currentSolenoid] / 10);
lcd.print(" >> cs");
} else {
lcd.print(Durations[currentSolenoid] / 10);
lcd.print(" cs");
}
updateLCD = false; // Reset the flag
}
}
void displaySavedMessage() {
// ... Display saved message logic ...
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("*******************");
lcd.setCursor(5, 1);
lcd.print("Solenoid ");
lcd.print(currentSolenoid + 1);
lcd.setCursor(7, 2);
lcd.print("Saved!");
lcd.setCursor(0, 3);
lcd.print("*******************");
}
void lockedScreen() {
// Mesage to apear on LCD when Switch activated to prevent button presses
lcd.setCursor(0, 0);
lcd.print("********************");
lcd.setCursor(0, 1);
lcd.print("*System Operational*");
lcd.setCursor(0, 2);
lcd.print("* Locked ");
lcd.write(0);
lcd.print(" *");
lcd.setCursor(0, 3);
lcd.print("********************");
}
void saveValuesToEEPROM() {
// ... EEPROM value saving logic ...
for (int i = 0; i < numSolenoids; i++) {
EEPROM.update(18 + i * 3, Offsets[i] / 10);
EEPROM.update(i * 3, Durations[i] / 10);
}
printlnBoth("Values saved to EEPROM.");
printEEPROMValues();
}
void loadValuesFromEEPROM() {
// ... EEPROM value loading logic ...
printlnBoth("-Loading Values");
for (int i = 0; i < numSolenoids; i++) {
Offsets[i] = EEPROM.read(18 + i * 3) * 10;
Durations[i] = EEPROM.read(i * 3) * 10;
timers[i] = Timer(Durations[i]); // Initialize the timers
delays[i] = Delay(Offsets[i]); // Initialize the delays
}
findMaxSolenoidTime();
}
void startRelaySequence() {
// ... Start relay sequence logic ...
for (int i = 0; i < numSolenoids; i++) {
delays[i] = Delay(Offsets[i]);
delays[i].start();
timers[i] = Timer(Durations[i]);
}
}
void updateRelays() {
// ... Update relays logic ...
for (int i = 0; i < numSolenoids; i++) {
if (delays[i].event()) {
relayStates[i] = HIGH;
digitalWrite(relayPins[i], relayStates[i]);
delays[i].stop();
timers[i].start();
}
if (timers[i].event()) {
relayStates[i] = LOW;
digitalWrite(relayPins[i], relayStates[i]);
timers[i].stop();
}
}
}
void printEEPROMValues() {
findMaxSolenoidTime();
printlnBoth("------------------------------------------------");
for (int i = 0; i < numSolenoids; i++) {
printBoth("Solenoid ");
printBoth(i + 1);
printBoth(" Opening Time [ ");
printBoth(EEPROM.read(i * 3) * 10);
printBoth(" ] Offset [ ");
printBoth(EEPROM.read(18 + i * 3) * 10);
printlnBoth(" ]");
}
printlnBoth("------------------------------------------------");
printBoth("Max Interval is : ");
printBoth(maxInterval / 10);
printBoth(" cs = ");
printBoth(maxInterval);
printlnBoth(" ms");
printlnBoth("------------------------------------------------");
}
void setDefaultValues() {
for (int i = 0; i < numSolenoids; i++) {
if (i == 0 || i == 2 || i == 4) { // Solenoids 1, 3, 5
Offsets[i] = 0;
} else { // The rest of the solenoids
Offsets[i] = 500;
}
Durations[i] = 60;
EEPROM.update(18 + i * 3, Offsets[i] / 10);
EEPROM.update(i * 3, Durations[i] / 10);
}
printlnBoth("Default Values Saved to EEPROM.");
updateLCD = true; // Set the flag to update the LCD
findMaxSolenoidTime();
printEEPROMValues();
}
void resetEEPROMValues() {
// Get the total number of bytes in the EEPROM
wipeEEPROMmessage();
int eepromSize = EEPROM.length();
// Zero out the entire EEPROM
for (int i = 0; i < eepromSize; i++) {
EEPROM.update(i, 0);
}
findMaxSolenoidTime();
loadValuesFromEEPROM();
printEEPROMValues();
printlnBoth("All calculated storage addresses of EEPROM set to 0");
updateLCD = true; // Set the flag to update the LCD
}
void wipeEEPROMmessage() {
int eepromSize = EEPROM.length();
const int lcdWidth = 20; // Assuming a 20 character wide LCD
const int serialWidth = 48; // Maximum number of dots to display in Serial monitor
const int loadingBarLength = lcdWidth - 2; // Adjust for borders
unsigned long startTime = millis();
unsigned long endTime = startTime + wipeEEPROMDuration;
lcd.clear();
lcd.setCursor(2, 1);
lcd.print("Deleting values");
lcd.setCursor(0, 2);
lcd.print("["); // Start of the loading bar
lcd.setCursor(lcdWidth - 1, 2);
lcd.print("]"); // End of the loading bar
printlnBoth("|------------Deleting EEPROM values------------|");
printBoth(" ");
int serialWidthPrinted = 0; // Seting limit for serial print
// Calculate how many EEPROM cells to wipe per loop iteration
int wipePerIteration = eepromSize / loadingBarLength;
int serialProgressPerIteration = eepromSize / serialWidth;
while (millis() < endTime) {
unsigned long currentTime = millis();
int progress = map(currentTime - startTime, 0, wipeEEPROMDuration, 0, loadingBarLength);
int serialProgress = map(currentTime - startTime, 0, wipeEEPROMDuration, 0, serialWidth);
lcd.setCursor(1, 2); // Position cursor after the start bracket
for (int i = 0; i < progress; i++) {
lcd.print("="); // Fill the bar with '=' characters
}
for (int i = progress; i < loadingBarLength; i++) {
lcd.print("_"); // Fill the rest with spaces
}
/* for (int i = 0; i < serialProgress; i++) {
printBoth("."); // Add a dot for each progress step
} */
while (serialWidthPrinted < serialProgress) {
printBoth("o");
serialWidthPrinted++;
delay(100); // Update every 100 milliseconds
}
}
printlnBoth(" ");
// Ensure any remaining EEPROM cells are wiped
for (int i = (loadingBarLength - 1) * wipePerIteration; i < eepromSize; i++) {
EEPROM.update(i, 0);
}
}
void printBuildInfo() {
printlnBoth(" -------------------------------------------------");
printlnBoth("| Build Information |");
printlnBoth(" -------------------------------------------------");
printlnBoth("| Creator: Kornelijus |");
printlnBoth("| Date Code Amended: 2024-01-07 |");
printlnBoth("| Board: Arduino Mega 2560 Rev3E |");
printlnBoth("| Board Serial Number: 4423631373535190F130 |");
printlnBoth("| Build Version : v2.4.1 BT + SIM COMMANDS |");
printlnBoth("| Sketch uses : 16366 bytes (6%) |");
printlnBoth("| Global variables : 2271 bytes (27%) |");
printlnBoth("| BT Module + Name : HC-05 + Flow Control 1 |");
printlnBoth("| BT PIN : 50051 |");
printlnBoth(" -------------------------------------------------");
}
void displayBootloader() {
const int loadingBarLength = 20; // Length of the loading bar (depends on your LCD)
unsigned long startTime = millis();
unsigned long endTime = startTime + bootloaderDuration;
lcd.clear();
lcd.setCursor(6, 1);
lcd.print("Loading!");
while (millis() < endTime) {
unsigned long currentTime = millis();
int progress = map(currentTime - startTime, 0, bootloaderDuration, 0, loadingBarLength);
lcd.setCursor(0, 2);
lcd.print("|");
for (int i = 0; i < progress; i++) {
lcd.print("=");
}
for (int i = progress; i < loadingBarLength; i++) {
lcd.print("");
}
lcd.print("|");
delay(100);
}
}
void displayHelp() {
printlnBoth("List of available comands");
printlnBoth("menu");
printlnBoth("exit");
printlnBoth("sim");
printlnBoth("stop sim");
printlnBoth("clean");
printlnBoth("stop clean");
printlnBoth("print");
printlnBoth("DEFAULT");
printlnBoth("ZERO");
printlnBoth("x/xx/xx");
printlnBoth("info");
printlnBoth("squirt x");
printlnBoth("help");
printlnBoth("...");
printlnBoth("......");
}
void printBTdata() {
printlnBoth(" Bluethooth Information ");
printlnBoth("IF name is HC-05 or HC-06 then the pins should be");
printlnBoth(" 1234 or 0000");
printlnBoth("");
printlnBoth("");
printlnBoth("If preprogrammed by Kornelijus the name should be");
printlnBoth(" NAME = Flow Control x "); // x stands as a number for the BT module being used"
printlnBoth(" PIN = 5005x ");
printlnBoth("");
}