Go Down

Topic: Display hx8347l (Read 1 time) previous topic - next topic

Litzy

The display works, I Submitted The Library URTouch, and Without calibration, I can instead to distance display on screen data and now, I Uploaded the sketch DS1307 Checked the CONNECTIONS, and pins, MA compare Shield White Again, if you come delete The previous sketch. Apologizes for mail stupid and Trivial Questions, to see written, time and data display LiquidCrystal I use the library? What a load every time I see a new sketch white screen! Still excuse for Questions Trivial.
Thank you

david_prentice

Please attach your sketch.

DS1307 and a Touch Display are standard components.
Another member could build and run your sketch and debug it for you.

The TFT shield plugs into your Mega2560.
The DS1307 connects to the SDA, SCL pins.   Use some angle header pin strip to fit between shield and Arduino to access SDA, SCL.

Oh,  why not write your message carefully in Italian?   Then ask Google to translate it to English for the Forum.

David.

Litzy

Ok, traducevo io il messaggio :)

Il modulo rtc é questo: http://www.electronicoscaldas.com/temporizadores-relojes/750-modulo-rtc-con-ds1307-y-memoria-eeprom.html
Ho collegato:i pin 20  al pin SDA, il pin 21 al pin SCL , il GND al pin GND, il pin VCC al pin 5v.

Ho scaricato sia la libreria Ds1307 che la libreria RTClib.master, caricando lo sketch non da errori, visualizzo solo il display bianco.
Grazie tantissimo per la pazienza.

david_prentice

Google Translate says:
Quote
Ok, I was translating the message :)

The rtc form is this: http://www.electronicoscaldas.com/temporizadores-relojes/750-modulo-rtc-con-ds1307-y-memoria-eeprom.html
I connected: pins 20 to the SDA pin, the pin 21 to pin SCL, GND to GND pin, the pin VCC to pin 5v.

I downloaded both the DS1307 library that the library RTClib.master, uploading the sketch have not errors, just the white display visualize.
Thank you so much for your patience.
That looks fine.   My Shield has got a chip near the D20, D21 pins on the Mega.  But I can fit some angle header pins ok.   Put some plastic tape over angle pins.

Please post (or attach) your sketch.   

David.

Litzy

Come si vede in foto lo sketch non da errori, a caricamento ultimato visualizzo lo schermo bianco.

 Date and time functions using a DS1307 RTC connected via I2C and Wire lib
#include <Wire.h>
#include "RTClib.h"

#if defined(ARDUINO_ARCH_SAMD)
// for Zero, output on USB Serial console, remove line below if using programming port to program the Zero!
   #define Serial SerialUSB
#endif

RTC_DS1307 rtc;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

void setup () {

#ifndef ESP8266
  while (!Serial); // for Leonardo/Micro/Zero
#endif

  Serial.begin(57600);
  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }

  if (! rtc.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date & time, for example to set
    // January 21, 2014 at 3am you would call:
    // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
  }
}

void loop () {
    DateTime now = rtc.now();
   
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(" (");
    Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
    Serial.print(") ");
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
   
    Serial.print(" since midnight 1/1/1970 = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");
   
    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now + TimeSpan(7,12,30,6));
   
    Serial.print(" now + 7d + 30s: ");
    Serial.print(future.year(), DEC);
    Serial.print('/');
    Serial.print(future.month(), DEC);
    Serial.print('/');
    Serial.print(future.day(), DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(':');
    Serial.print(future.minute(), DEC);
    Serial.print(':');
    Serial.print(future.second(), DEC);
    Serial.println();
   
    Serial.println();
    delay(3000);
}



Spero di aver fatto corretti i collegamenti.

david_prentice

So what is the problem?

I installed RTClib and built your sketch.   With DS1307 on pins 18, 19, 20, 21.    
It displays the time on Serial at 9600 baud.

I then added the TFT Shield.   Note that my controller ID is 0x6814.   Your HX8347-I is 0x9595.

Code: [Select]

#include <Wire.h>
#include "RTClib.h"
#include <MCUFRIEND_kbv.h>  //.kbv
MCUFRIEND_kbv tft;          //.kbv

#if defined(ARDUINO_ARCH_SAMD)
// for Zero, output on USB Serial console, remove line below if using programming port to program the Zero!
#define Serial SerialUSB
#endif

RTC_DS1307 rtc;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

void setup () {

#ifndef ESP8266
    while (!Serial); // for Leonardo/Micro/Zero
#endif

    Serial.begin(9600);
    pinMode(18, OUTPUT);     //.kbv power the DS1307 via 18, 19
    pinMode(19, OUTPUT);
    digitalWrite(18, LOW);   //0V
    digitalWrite(19, HIGH);  //5V
    tft.begin(0x6814);       //.kbv you use 0x9595
    tft.setRotation(1);      //.kbv LANDSCAPE
    tft.fillScreen(0xF800);  //.kbv RED
    tft.setTextColor(0xFFFF, 0x0000); //WHITE text on BLACK
    tft.setTextSize(2);

    if (! rtc.begin()) {
        Serial.println("Couldn't find RTC");
        while (1);
    }

    if (! rtc.isrunning()) {
        Serial.println("RTC is NOT running!");
        // following line sets the RTC to the date & time this sketch was compiled
        rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
        // This line sets the RTC with an explicit date & time, for example to set
        // January 21, 2014 at 3am you would call:
        // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
    }
}

void tfttime(DateTime now)   //.kbv
{
    tft.setCursor(20, 20);
    tft.print(now.year(), DEC);
    tft.print('/');
    tft.print(now.month(), DEC);
    tft.print('/');
    tft.print(now.day(), DEC);
    tft.print(" ");
    tft.print(now.hour(), DEC);
    tft.print(':');
    tft.print(now.minute(), DEC);
    tft.print(':');
    tft.print(now.second(), DEC);
}

void loop () {
    DateTime now = rtc.now();
    tfttime(now);              //.kbv
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(" (");
    Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
    Serial.print(") ");
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();

    Serial.print(" since midnight 1/1/1970 = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");

    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now + TimeSpan(7, 12, 30, 6));

    Serial.print(" now + 7d + 30s: ");
    Serial.print(future.year(), DEC);
    Serial.print('/');
    Serial.print(future.month(), DEC);
    Serial.print('/');
    Serial.print(future.day(), DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(':');
    Serial.print(future.minute(), DEC);
    Serial.print(':');
    Serial.print(future.second(), DEC);
    Serial.println();

    Serial.println();
    delay(3000);
}


If you want me to test your Touch code,  please paste / attach your sketch.

David.

Litzy

ho copiato il tuo sketch, modificato tft. con 0x9595, ma non funziona , sempre schermo bianco.

david_prentice

Please can you call Google Translate before  posting.
Quote
I copied your sketch, modified TFT. with 0x9595, but it does not work, more and white screen
I would expect the sketch to work if you used tft.begin(0x9595)
I presume that you have powered your DS1307 externally.


Very few people have exactly the same Display shield that you own.
I just have a 320x480 Display with RM68140 controller and 16-bit interface.
I can reproduce your smaller 240x320 images.
I can test the XPT2046 Touch Controller chip (which is exactly like yours)

Please attach your sketches for me to try.
Both the sketch in your JPEG from #19 and my sketch from #20 that you have edited.

I speak English and you speak Italian.    Google is our friend.
Your MEGA2560 speaks Arduino language.   It is the same Arduino language for me in England and you in Italy.

David.

Litzy

ho provato in questo modo:

#ifndef ESP8266
    while (!Serial); // for Leonardo/Micro/Zero
#endif

    Serial.begin(9600);
    pinMode(18, OUTPUT);     //.kbv power the DS1307 via 18, 19, 20, 21
    pinMode(19, OUTPUT);
    digitalWrite(18, LOW);   //0V
    digitalWrite(19, HIGH);  //5V
    tft.begin(0x9595);       
    tft.setRotation(1);      //.kbv LANDSCAPE
    tft.fillScreen(0xF800);  //.kbv RED
    tft.setTextColor(0xFFFF, 0x0000); //WHITE text on BLACK
    tft.setTextSize(2);


sicuramente sbaglio io, o rtc non funziona , lunedì verifico con un voltmetro

Litzy

#24
Feb 25, 2017, 06:12 pm Last Edit: Feb 25, 2017, 08:01 pm by Litzy
Il modulo rtc non da segni di vita, ho comprato un nuovo rtc, dovrebbe arrivare lunedì.  Lo sketch  che ho compilato è corretto?
Grazie

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy