0 votes
in Touch Interface by (120 points)
Hello all,

First off, thank you for your help in advance.

I am having trouble with the displayed time with my setup. The displayed time blinks constantly while my unit is running. Has anyone else experienced this problem? Thank you again!
by (19.9k points)
Can you provide a video somewhere so we get an idea about that behaviour? It's unrelated to  https://github.com/ThingPulse/esp8266-weather-station-color/issues/108 is it?
by (120 points)
Hi Marcel,

Upon further inspection that exactly what is happening. My fix below was to modify the code line (true) and (false) statements. It took care of the problem. I also eliminated the! further up in the code per the thread recommendations. My modification is below.

I like many others am unable to access the touch features. I'll play around in the forum and see if I can't work that out too.

Thank you again for your help!



// draws the clock
void drawTime() {
  char time_str[11];
  time_t now = time(nullptr);
  struct tm * timeinfo = localtime(&now);

  gfx.setTextAlignment(TEXT_ALIGN_CENTER);
  gfx.setFont(ArialRoundedMTBold_14);
  gfx.setColor(MINI_WHITE);
  String date = WDAY_NAMES[timeinfo->tm_wday] + " " + MONTH_NAMES[timeinfo->tm_mon] + " " + String(timeinfo->tm_mday) + " " + String(1900 + timeinfo->tm_year);
  gfx.drawString(120, 6, date);

  gfx.setFont(ArialRoundedMTBold_36);

  if (false) {
    int hour = (timeinfo->tm_hour + 11) % 12 + 1; // take care of noon and midnight
    sprintf(time_str, "%2d:%02d:%02d\n", hour, timeinfo->tm_min, timeinfo->tm_sec);
  } else {
    sprintf(time_str, "%02d:%02d:%02d\n", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
  }
  gfx.drawString(120, 20, time_str);

  gfx.setTextAlignment(TEXT_ALIGN_LEFT);
  gfx.setFont(ArialMT_Plain_10);
  gfx.setColor(MINI_BLUE);
  if (true) {
    sprintf(time_str, "\n%s", timeinfo->tm_hour >= 12 ? "PM" : "AM");
    gfx.drawString(195, 27, time_str);
  }
}
by (19.9k points)
Glad that link helped. We were never able to reproduce any of these reported issues. However, it might be that the two issues (blinking, lacking touch) are actually related. A couple of ideas:

- try to wipe the calibration file the app writes to SPIFFS by erasing SPIFFS upon installing the application (Arduino IDE > Tools > flash settings)
- verify the solder joints again, take a look at the ones related to the touch display (T_x at https://docs.thingpulse.com/specs/wifi-color-display-kit/)
- at https://github.com/ThingPulse/esp8266-weather-station-color/blob/master/esp8266-weather-station-color.ino#L240 we alternate that IS_STYLE_12HR variable if we detect a touch in a certain area to allow to switch between 12/24 style; maybe print out the touch coordinates right before the if-statement

Please log in or register to answer this question.

Welcome to ThingPulse Q&A, where you can ask questions and receive answers from other members of the community.

https://thingpulse.com

...