satspares / DWIN_DGUS_HMI

Arduino Libabry for DWIN DGUS T5L HMI Displays
15 stars 3 forks source link

no effect #6

Closed maxim-sedilec closed 8 months ago

maxim-sedilec commented 8 months ago

this function has no effect/not work on my DMG80480T043_09WTC
hmi.setRTC(byte year, byte month, byte day, byte hour, byte minute, byte second) hmi.setRTCSOFT(byte 24, byte 01, byte 17, byte 03, byte hour, byte minute, byte second) i try hmi.setRTC(24, 01, 17, 17, 05, 30); or hmi.setRTCSOFT(24, 01, 19, 03, 17, 15, 30); and ....nothing hapent.

hmi.setTextColor(0x3000, 0x03, 0x281F);  // BLUE text
hmi.setText(0x3000, "WIZaRD!");

hmi.setTextColor(vp_add, 0x03, colorHEX); show text on 0x3000 field but no color change my setup AVR128DA48 / DMG80480T043_09WTC / arduinoIDE 1.819

satspares commented 8 months ago

Post up somewhere an example of your Arduino code and DWIN app and I will take a look.

maxim-sedilec commented 8 months ago
hmi.setTextColor(0x3000, 0x03, 0x281F);  // BLUE text
hmi.setText(0x3000, "WIZaRDI!"); 

text apear on white/ color set from dgus software hmi.setRTCSOFT(24, 01, 19, 03, 17, 15, 30); and hmi.setRTC(24, 01, 17, 17, 05, 30); - do nothing.

satspares commented 8 months ago

With the RTC on the screen does it display anything? Without any command from serial it still should be running and from new showing china time.

Is it a text control you are trying to change color or some other control?

maxim-sedilec commented 8 months ago

RTC it's running and show factory time 2017-01-01......now 2017-01-11... working for 10 days. //setup

define DGUS_BAUD 115200

define FORCEHWSERIAL

if defined(AVR_ATmega1280) || defined(AVR_ATmega2560) || defined(FORCEHWSERIAL)

define DGUS_SERIAL Serial2

DWIN hmi(DGUS_SERIAL, DGUS_BAUD);

endif

//serial is work, i change page, show float, integer, text, change page, read and set vp value //hmi.setVPWord(0x1000,v1000var); //ok //hmi.setintValue(0x2100, f); //ok //hmi.beepHMI(); //ok //hmi.setFloatValue(0x2100, VALUE); //ok //hmi.setPage(PAGE); //ok //hmi.restartHMI(); //ok //hmi.getHWVersion() //ok

//hmi.setRTC(byte year, byte month, byte day, byte hour, byte minute, byte second) // not set RTC // hmi.setTextColor(0x1200, 0x03, 0x07E0); // Green 0x281F BLUE // ignored set color //loop PAGE = hmi.getPage(); //working ICON_SET = readVP(0x7000); if(PAGE == 5) { //hmi.setVPByte(0x7000,0x5);
hmi.setTextColor(0x1200, 0x03, 0x07E0); // Green 0x281F BLUE hmi.setText(0x1200, "NO FUNCIONA!"); hmi.setTextColor(0x6100, 0x03, 0x281F); // BLUE text hmi.setText(0x6100, DWIN_PRINT); hmi.setTextColor(0x3000, 0x03, 0x281F); // BLUE text hmi.setText(0x3000, "WIZaRDI!"); float f = 12345678; hmi.setFloatValue(0x2100, SNS1_cREV); hmi.setFloatValue(0x2200, f); hmi.setFloatValue(0x2500, PROCENT_BAT_S1); hmi.setFloatValue(0x2600, PROCENT_BAT_S2); hmi.setFloatValue(0x2700, PROCENT_BAT);
hmi.listen(); } Serial.print("PAGE "); Serial.print(PAGE); Serial.print(" ICON "); Serial.println(ICON_SET);

satspares commented 8 months ago

Thanks for the info I will take a look later today.

satspares commented 8 months ago

Hello, To set the text color and other properties you need to use the description pointer address. Named SP on the dgus app I normally set this to something over 0x5000. Your hmi.setRTC(24, 01, 17, 17, 05, 30); works fine for me so I am not sure what the problem here is.

satspares commented 8 months ago

This is my old way to set the RTC this should also work for you.

    Serial2.write(0x5A);
    Serial2.write(0xA5);
    Serial2.write(0x0B); // 11 bytes to tx
    Serial2.write(0x82);
    Serial2.write(0x00);
    Serial2.write(0x9c); // 9c address
    Serial2.write(0x5A);
    Serial2.write(0xA5); // set rtc
    Serial2.write(byteYear);
    delayMicroseconds(1);
    Serial2.write(byteMonth);
    delayMicroseconds(1);
    Serial2.write(byteDay);
    delayMicroseconds(1);
    Serial2.write(byteHours);
    delayMicroseconds(1);
    Serial2.write(byteMinutes);
    delayMicroseconds(1);
    Serial2.write(byteSeconds);
maxim-sedilec commented 8 months ago

thanks a lot, old way for RTCset its working! hmi.setTextColor(spADDRESS, 0x03, COLOR); works fine!!!