Forum Software Ferduino code Home screen problem

Home screen problem  [SOLVED]


Post Number:#1 Post Fri Jan 02, 2015 4:36 am
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 44
Location: England
Gender: Male
National Flag:
Great Britain
Hi Fernando,

I have installed the latest code and all the menus etc work, but when I click the home button, it loads the home page then goes straight back to the menu1 screen again. I cannot get it to stay on the home screen.

I have tried searching but cannot find any other posts with this problem.

Thanks in advance

Post Number:#2 Post Fri Jan 02, 2015 11:32 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

I can't see this problem in my controller.

Did you some changes in ProcessMyTouch()?

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Fri Jan 02, 2015 11:49 am
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 44
Location: England
Gender: Male
National Flag:
Great Britain
After calibration, I put in the password and it came to 'menu1', then selecting 'home' loaded it briefly then went straight back to 'menu1' so I changed the code to remove the password and this still happens but going to the 'menu1' now instead of password screen. I cant recall changing anything else in that tab but I will scan through tonight and see if I have maybe by accident.

-------------------------------- Last edited Fri Jan 02, 2015 3:06 pm --------------------------------

I have just looked at a copy of the code. I have only changed code as per your topic for removing the password screen and changed


x=myTouch.getX ();
y=myTouch.getY ();


to

x = 399-myTouch.getX ();
y = 239-myTouch.getY ();


as my calibration left my touches 180 degrees rotated.

Nothing else has changed in this tab

Post Number:#4 Post Fri Jan 02, 2015 11:43 pm
Posts: 274
Topics: 6
Images: 46
Solve rating: 0
Joined: Mon Sep 08, 2014 1:35 am
Topics: 6
Age: 42
Location: Aurora
Gender: Male
National Flag:
United States of America

Check code to make sure your are still the same ether ferduino 7,6,5,4,3. or arduino 6,5,4,3,2. depending on your build its easy to miss I have done it many times. every time it skips the home screen.
Happy reefing to all.
Christopher Kindig

Post Number:#5 Post Mon Jan 05, 2015 7:46 pm
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 44
Location: England
Gender: Male
National Flag:
Great Britain
The code is the correct version, but I have been trying the sd and ethernet test codes and couldn't get them to work until I removed the tft shield.

On closer inspection, I only removed pin 53 from the shield not all 4 for using the network shield sd card x_x . I have the white tft shield. I will try taking those 3 out tomorrow and see if that gets me any further :)

Post Number:#6 Post Tue Jan 06, 2015 5:29 pm
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 44
Location: England
Gender: Male
National Flag:
Great Britain
Well now I am stumped #-o . I have removed the 3 other pins, and now the sd and network work. I can log in with joyreef etc and that side is fine but it will just not let me stay on the home screen. My code for the my touch that was changed is

void processMyTouch()
{
  myTouch.read();
  int x, y;                  // Coordenadas do touch screen
  x = 399-myTouch.getX ();
  y = 239-myTouch.getY ();

  if(temperatura_alta == false) // Limpa mensagem de que a temperatura dos leds esteve alta.
  {
    temperatura_baixou = false;
  }
  if ((x>=iniC[0]) && (x<=iniC[2]) && (y>=iniC[1]) && (y<=iniC[3]) && (dispScreen!=0) && (LEDtestTick == false) && (horario_alterado == false))  // volta ao inicio
  {
    waitForIt(iniC[0], iniC[1], iniC[2], iniC[3]);
    if((dispScreen == 5) || (dispScreen == 28))
    {
      ReadFromEEPROM();
    }
    else if(dispScreen == 10)
    {
      ler_wave_EEPROM();
    }
    else if(dispScreen == 30)
    {
      stCurrentLen=0;
      memcpy(stCurrent, limpar_senha, sizeof(limpar_senha));
    }
    else if(dispScreen == 22)
    {
      ler_predefinido_EEPROM();
    }
    periodo_selecionado = false;
    dispScreen=0;
    clearScreen();
    mainScreen(true);   

  }
  else
  {
    switch (dispScreen)
    {
    case 0:                       //Tela de inico
       dispScreen=1;
       clearScreen();
       menuScreen();
       break;


and this is the touch section on ferduino tab

UTFT        myGLCD(ITDB32WD, 38,39,40,41);   // "ITDB32WD" é o modelo do LCD
UTouch      myTouch(6,5,4,3,2);              // Comente esta linha para usar o Ferduino Mega 2560
//UTouch      myTouch(7,6,5,4,3);           // Descomente esta linha para usar o Ferduino Mega 2560

unsigned long previousMillis = 0;
String day, ano;
byte whiteLed, blueLed, azulroyalLed, vermelhoLed, violetaLed;    // Valor anterior de PWM.
byte dispScreen = 0;


If anyone has any other ideas why it man be doing this, I would appreciate it.

To confirm the problem, It loads the main screen and after it jumps straight to menu1, if you click home button, it loads that screen then jumps straight back again.

Post Number:#7 Post Tue Jan 06, 2015 6:57 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

I think that you have problem on TFT.

Try this code to check.

After:

  int x, y;                  // Coordenadas do touch screen


Add:

  Serial.print("X = ");
  Serial.println(myTouch.getX());
  Serial.print("Y = ");
  Serial.println(myTouch.getY());


Check on serial monitor if have some value without touch the TFT.

Maybe it can solve:

    case 0:
      if ((x >= 1) && (x <= 300) && (y >= 50) && (y <= 239)
      {
       dispScreen=1;
       clearScreen();
       menuScreen();
      }
      break;


Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#8 Post Tue Jan 06, 2015 7:19 pm
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 44
Location: England
Gender: Male
National Flag:
Great Britain
Thank you. I tried the first option and got no serial response at all. The second option has made the home screen work. It now stays there and refreshes all the data every 5 seconds, except it is not updating the temperature on the screen. If I go to the temp probe selection it updates then freezes again. If its not a related issue then I will mark this as solved and look for a resolution to the new issue.

From the code you posted, do you know what was wrong and why it didnt work before?

Thanks again

Guy

Actually, It updates the temp on screen after about 2 minutes each time?

Post Number:#9 Post Tue Jan 06, 2015 7:46 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

The code is right. Should be problem on touch.

The temperature is updated to each 60 seconds. The value is an average of 12 readings.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.




Return to Ferduino code





Who is online

Users viewing this topic: No registered users and 1 guest