Vivarium controller

some years ago i modified a program for aquariums to run my vivariums, with an arduino mega and a 3.2" tft. sadly i can no longer get the 3.2" tft and have a 3.5" tft. i have transfered most of the program to the 3.5" tft but am having problems converting the touch screen and the eeprom info.
the old program used uptouch the new one uses touchscreen.
the program has 9 vivariums showing temp, 12 timer staus and home ,setup button.
i can program a bit so the program will look a mess.
can anyone help me finish this for a fee ?
not sure if this is correct forum.
the old unit is still running but i want to upgrade the wiring and move to a bigger touch screen.
i have no problem with the hardware it is just the software.

@normet, your topic was moved to a more suitable location on the forum.

Please provide links to the old screen (if possible) and the new screen. Please post your code; advise how to post your code can be found in How to get the best out of this forum.

the code is 4000 lines can i post that much.
you say it has been moved but do not give new addree?

The correct place to ask if you want to pay someone to do your project is Gigs and Collaborations, I have moved your post for you.

thank you

If you look under the title, you will see where it is :wink:

Mea Culpa

1 Like

The legend i am looking for is,
Home Page, vivs 1 to 9 with temp display, timer status display home and setup button.
Settings page, general settings button, time and date button, timer settings button, manual control button, temperature button, home button.
General settings page, calendar format ddmmyy, show dotw on/off, time format 12/24h, temp scale C /F. Save button home button.
Time & Date page, Time change, hours up/down button, minutes up/down button. Date day up/down button, month up/down button, year up/down button. Show dotw if on .
Timer settings, 12 relays with on and off time displayed, click any relay opens time set screen.
Time set screen, on with hour and minute button, off with hour and min button. Save button.
Manual control timers, auto/on/off buttons to switch relays.

i have 4000 lines of code at present.
here are the libraries info at the top.



"//LIBRARIES
#include <avr/pgmspace.h>
#include <Wire.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <DS1307.h>
#include <EEPROM.h>
#include "writeAnything.h"
#include <TouchScreen.h>
#define MINPRESSURE 200
#define MAXPRESSURE 1000
//Default Controller Settings
boolean RECOM_RCD = true;            //For Mean Well drivers change "true" to "false"
#include <UTFTGLUE.h>              //use GLUE class and constructor
UTFTGLUE myGLCD(0,A2,A1,A3,A4,A0); //all dummy args
#define YP A2  // must be an analog pin
#define XM A1  // must be an analog pin
#define YM 6   // can be a digital pin
#define XP 7   // can be a digital pin
#define TS_MINX 0
#define TS_MINY 0 
#define TS_MAXX 475
#define TS_MAXY 320
//Create the touchscreen object
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);

//Some of the tft pins
#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
// Optional, used to reset the display
#define LCD_RESET A4

//Minimum and maximum pressure to sense the touch
#define MINPRESSURE 10
#define MAXPRESSURE 1000

int currentpage;

//Initialize the DS1307
DS1307 rtc(20, 21);
DS1307_RAM ramBuffer;                //Declare a buffer for use
Time t, t_temp;                      //Init Time-data structure
int rtcSetMin, rtcSetHr, rtcSetDy, 
    rtcSetMon, rtcSetYr;    
int setCalendarFormat = 0;           //DD/MM/YYYY=0 || Month DD, YYYY=1 (change in prog)
int displayDOW = 0;                  //Hide=0 || Show=1 (change in prog)
int setTimeFormat = 0;               //24HR=0 || 12HR=1 (change in prog)
int AM_PM, yTime;                    //Setting clock stuff
int timeDispH, timeDispM, 
    xTimeH, xTimeM10, xTimeM1, 
    xTimeAMPM, xColon;
String time, day; 
int setClockOrBlank = 0;             //Clock Screensaver=0 || Blank Screen=1 (change in prog)

boolean SCREEN_RETURN = true;        //Auto Return to mainScreen() after so long of inactivity
int returnTimer = 0;                 //counter for Screen Return
int setReturnTimer;                  //Return to main screen 75% of time before the screensaver turns on

//Declare which fonts to be utilized
//extern uint8_t TinyFont[];
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SmallFont[];
//extern uint8_t SevenSegNumFontPlus[];
                   
int LARGE=0;
int SMALL=1;

//Relay Timers
const int timer1 = A0;               //Timer 1 to be defined
const int timer2 = A1;               //Timer 2 to be defined
const int timer3 = A2;               //Timer 3 to be defined
const int timer4 = A3;               //Timer 4 to be defined
const int timer5 = A4;               //Timer 5 to be defined
const int timer6 = A5;               //Timer 6 to be defined
const int timer7 = A6;               //Timer 7 to be defined
const int timer8 = A7;               //Timer 8 to be defined
const int timer9 = A8;               //Timer 9 to be defined
const int timer10 = A9;               //Timer 10 to be defined
const int timer11 = A10;               //Timer 11 to be defined
const int timer12 = A11;               //Timer 12 to be defined

// DS18B20 Temperature sensors plugged into pin 51 (Water, Hood, & Sump)
OneWire OneWireBus(51);              //(51) Choose a digital pin 
// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&OneWireBus);   
// Assign the addresses of temperature sensors.  Add/Change addresses as needed.
DeviceAddress viv1Thermometer = { 0x28, 0xFF, 0xB1, 0xA3, 0x24, 0x17, 0x03, 0x81 };
DeviceAddress viv2Thermometer = { 0x28, 0xFF, 0xB1, 0xA3, 0x24, 0x17, 0x03, 0x81 };
DeviceAddress viv3Thermometer = { 0x28, 0xFF, 0xB1, 0xA3, 0x24, 0x17, 0x03, 0x81 };
DeviceAddress viv4Thermometer = { 0x28, 0xFF, 0x7F, 0xC4, 0xA7, 0x16, 0x05, 0x88 };
DeviceAddress viv5Thermometer = { 0x28, 0xFF, 0x90, 0x5E, 0x00, 0x17, 0x04, 0xD1 };
DeviceAddress viv6Thermometer = { 0x28, 0xFF, 0x68, 0x00, 0x00, 0x17, 0x03, 0x07 };
DeviceAddress viv7Thermometer = { 0x28, 0xFF, 0x8C, 0x37, 0x00, 0x17, 0x03, 0x0C };
DeviceAddress viv8Thermometer = { 0x28, 0xFF, 0x7F, 0xC4, 0xA7, 0x16, 0x05, 0x88 };
DeviceAddress viv9Thermometer = { 0x28, 0xFF, 0x7F, 0xC4, 0xA7, 0x16, 0x05, 0x88 };"

this is part of the main display

"void mainScreen(boolean refreshAll=false)
{
    clearScreen();
    myGLCD.setColor(245, 245, 245);
    myGLCD.drawCircle(448, 40, 21);
    myGLCD.setColor(64, 80, 84);
    myGLCD.fillCircle(448, 40, 20); 
    myGLCD.setColor(255, 255, 255);
    myGLCD.print("HOME",438 ,38);  
    myGLCD.setColor(255, 255, 255);
    myGLCD.drawCircle(448, 90, 21);
    myGLCD.setColor(14, 44, 44);  
    myGLCD.fillCircle(448, 90, 20);  
    myGLCD.setColor(255, 255, 255);
    myGLCD.print("SETUP",436 ,88);  

 String oldval, deg;  
  
    TimeDateBar(true);
    oldval = day;                                  //refresh day if different
   day = String(t.date);
  if ((oldval!=day) || refreshAll)
{
    myGLCD.setColor(25, 212, 218);                //Draw Borders & Dividers in Grey
    myGLCD.drawRect(0, 0, 475, 315);            //Outside Border
    myGLCD.drawRect(138, 14, 140, 315);         //Vertical Divider
    myGLCD.drawRect(276, 14, 278, 315);         //Vertical Divider
    myGLCD.drawRect(416, 14, 419, 315);         //Vertical Divider
    myGLCD.drawRect(0, 105, 415, 107);        //Horizontal Divider
    myGLCD.drawRect(0, 210, 415, 212);        //Horizontal Divider
    myGLCD.fillRect(0, 0, 475, 15);             //Top Bar
    myGLCD.setColor(0, 0, 0);
   setFont(LARGE, 255, 255, 255, 25, 212, 218);
    myGLCD.print("Vivarium-01", CENTER, 1);
   setFont(SMALL, 255, 255, 255, 0, 0, 0);
    myGLCD.print("Vivarium 1", 40, 20);
    myGLCD.print("Vivarium 2", 180, 20);
    myGLCD.print("Vivarium 3", 320, 20);
    myGLCD.print("Vivarium 4", 40, 111);
    myGLCD.print("Vivarium 5", 180, 111);
    myGLCD.print("Vivarium 6", 320, 111);
    myGLCD.print("Vivarium 7", 40, 215);
    myGLCD.print("Vivarium 8", 180, 215);
    myGLCD.print("Vivarium 9", 320, 215);
    
   setFont(SMALL, 255, 255, 255, 0, 0, 0);
    myGLCD.print("TIMER", 435, 120);
  for (int c=0; c<12; c++)
 { setFont(SMALL, 255, 255, 255, 0, 0, 0);
    myGLCD.printNumI(c+1, 427, (c*13)+145);
    myGLCD.setColor(64, 64, 64); 
    myGLCD.drawRect(425, (c*13)+140, 472, (c*13)+170); }
}
    TimerStatusMainScreen();

  if (setTempScale==1) {deg ="F";}               //Print deg C or deg F
  else {deg = "C";}
    degC_F=deg;
 char bufferDeg[2];
    degC_F.toCharArray(bufferDeg,2);
                                  
  if (refreshAll)                                //draw static elements

  {setFont(SMALL, 210, 210, 200, 0, 0 , 0);        //temp1
    myGLCD.print("Temp:", 10, 44);
    myGLCD.drawCircle(80, 46, 1);              
    myGLCD.print(bufferDeg, 84, 44);

    myGLCD.print("Temp:", 150, 44);      //temp2
    myGLCD.drawCircle(230, 46, 1);              
    myGLCD.print(bufferDeg, 236, 44);
    
    myGLCD.print("Temp:", 290, 44);      //temp3
    myGLCD.drawCircle(370, 46, 1);              
    myGLCD.print(bufferDeg, 376, 44);
    
    myGLCD.print("Temp:", 10, 132);      //temp4
    myGLCD.drawCircle(80, 134, 1);              
    myGLCD.print(bufferDeg, 84, 132);}

  if (refreshAll)                                //draw static elements

  {setFont(SMALL, 210, 210, 200, 0, 0 , 0);       
    myGLCD.print("Temp:", 150, 132);     //temp5
    myGLCD.drawCircle(230, 134, 1);              
    myGLCD.print(bufferDeg, 235, 132);

    myGLCD.print("Temp:", 290, 132);      //temp6
    myGLCD.drawCircle(370, 134, 1);              
    myGLCD.print(bufferDeg, 376, 132);
    
    myGLCD.print("Temp:", 10, 240);      //temp7
    myGLCD.drawCircle(80, 240, 1);              
    myGLCD.print(bufferDeg, 84, 240);
    
    myGLCD.print("Temp:", 150, 240);      //temp8
    myGLCD.drawCircle(230, 240, 1);              
    myGLCD.print(bufferDeg, 235, 240); 

    myGLCD.print("Temp:", 290, 240);      //temp9
    myGLCD.drawCircle(370, 240, 1);              
    myGLCD.print(bufferDeg, 375, 240);} 

    
  if ((tempv1>50) || (tempv1<20))                  //range in deg C no matter what3
   {setFont(SMALL, 255, 0, 0, 0, 0, 0);
    myGLCD.print("Bulb", 46, 44);}
  else 
{
  if (setTempScale==1) 
    { tempv1 = ((tempv1*1.8) + 32.05);}         //C to F with rounding
  if (tempCoolflag==true)                     // temperature too HIGH
       
  {setFont(SMALL, 255, 0, 0, 0, 0, 0);
    myGLCD.printNumF( tempv1, 1, 50, 44);
   setFont(SMALL, 255, 255, 0, 0, 0, 0);
    myGLCD.print("HOT", 46, 44);}
      
  if (tempHeatflag==true)                      // temperature too LOW
  {setFont(SMALL, 0, 0, 255, 0, 0, 0);
    myGLCD.printNumF( tempv1, 1, 50, 44);
   setFont(SMALL, 255, 255, 0, 0, 0, 0);
    myGLCD.print("COLD", 46, 44);}
  else 
  {setFont(SMALL, 0, 255, 0, 0, 0, 0);
    myGLCD.printNumF( tempv1, 1, 46, 44);} 
  if ((tempv1<100) && (tempv1>=0))
   {myGLCD.setColor(0, 0, 0);
    myGLCD.fillRect(131, 148, 139, 160);}
} " ```

Did you miss the bit on “How to post your code” ?