Xinyuan-LilyGO / LilyGo-T-RGB

MIT License
78 stars 24 forks source link

[Newbie] - this device is Useless without real functions... #9

Closed DeepCoreB4 closed 1 year ago

DeepCoreB4 commented 1 year ago

Hi.. How to connect this device with Bluetooth? All these demos are useless for a newbie in this field. The only thing that worked for me is playing gif animations. Now I ask myself the question? is that all? What should I do now? What do you use this device for?

Now I finally got the music demo version of LVGL to work. It only worked with the VSCode Platformio, Arduino IDE didn't work for me. Touch does not work. So I have no idea if playing the music is possible at all.

How to learn that at all...without a functional working example??

mmMicky commented 1 year ago

T-RGB uses ESP32S3 as the main control. This means that all the routines on github that support ESP32S3 do. It is impossible for me to collect all the examples on the internet. I can provide this board-specific driver such as the screen so that you can use it.

mmMicky commented 1 year ago

As far as I know, there are two types of touch chips. If you're not sure, you can take turns uncommenting here.

https://github.com/Xinyuan-LilyGO/T-RGB/blob/0fb2bc26e2eeb1a661385384c3e59848f99068f8/example/factory/factory.ino#L16

DeepCoreB4 commented 1 year ago

Hello mmMicky, thank you for your answer.

mmMicky> It is impossible for me to collect all the examples on the internet! ....> Yes, I realize that you can't create a working demo script for every device you develop. But if you add a specific resource from another repo for the device, you should assume it works!

mmMicky> As far as I know, there are two types of touch chips. If you're not sure, feel free to alternate here without comment. .....>

oK...i will try it hmmm When I comment out // #define TOUCH_MODULE_CST820 I get a compile error....

Edit: Now it works :)

I commented out these lines in:lvgl/src/misc/lv_style.h

Lines 60 to 64; /* On a simple system, don't waste resources on gradients /

if !defined(LV_DRAW_COMPLEX) || !defined(LV_GRADIENT_MAX_STOPS)

define LV_GRADIENT_MAX_STOPS 2

endif

And then I re-enabled the line //#define LV_GRADIENT_MAX_STOPS 2 in my lv_conf.h. Afterwards rebuilt - compiled and the error was gone...with some issu.. https://youtu.be/5nr7VfzsspU

mmMicky commented 1 year ago

My guess is that the touch chip receives interrupts consistently and the read XY coordinates are 0, 0. It seems that the coordinates of 0, 0 need to be defined as invalid coordinates to be normal.

mmMicky commented 1 year ago

Could you please add printf to print (X,Y) coordinates here to help me figure out the problem. https://github.com/Xinyuan-LilyGO/T-RGB/blob/0fb2bc26e2eeb1a661385384c3e59848f99068f8/example/lv_music/lv_music.ino#L139

DeepCoreB4 commented 1 year ago

Could you please add printf to print (X,Y) coordinates here to help me figure out the problem.

https://github.com/Xinyuan-LilyGO/T-RGB/blob/0fb2bc26e2eeb1a661385384c3e59848f99068f8/example/lv_music/lv_music.ino#L139

OK, I added a printf to read out the coordinates https://github.com/DeepCoreB4/LilyGo_T-RGB/commit/1dd537bc2a2c8d75411a98b41b27b32b1c269df7....

with; // to find a fix for touch issu............................ Serial.printf("Touch_Points_num(x,y): %llucoord\n", &x, &y); if (x > 0 || y > 1) { Serial.print("x,pos--> "); Serial.print(x); Serial.print("\ny,pos--> "); Serial.println(y); Serial.println("..."); Serial.printf("XL9535 0x%02x : 0x%02X \r\n", xl, data); Serial.println("End off touch_readPos < ..."); }//.........................................................

In the Serial Monitor I get the following result:

... Starting touch_readPos Touch_Points_num(x,y): 4597663406542958208coord x,pos--> 12080 y,pos--> 16334 ... XL9535 0x3fce2e84 : 0x3FCE2EE8 End off touch_readPos < ...

I don't know if this information is correct or helpful, or if the "printf" line is correct.

mmMicky commented 1 year ago

It should only be able to read the range from 0 to 480. Anything larger than this range is incorrect. There may be a communication error.

DeepCoreB4 commented 1 year ago

hmmm...ok

Now i have this Output; its change on every position i touch the screen....

**middle screen: center touch:**
Touch_Points_num(x,y): 4597663458082565772coord
x,pos--> 0
y,pos--> 271
...
End off touch_readPos ...< 

**relesed touch: middle center:**
>... Starting touch_readPos 
Touch_Points_num(x,y): 4597663458082565772coord
x,pos--> 128
y,pos--> 271

**right side midle screen:**
>... Starting touch_readPos 
Touch_Points_num(x,y): 4597663458082565772coord
x,pos--> 257
y,pos--> 284
...
End off touch_readPos ...<

**Left middle screen**
>... Starting touch_readPos 
Touch_Points_num(x,y): 4597663458082565772coord
x,pos--> 44
y,pos--> 286
...
End off touch_readPos ...<

what now?? what can i do with this data?

mmMicky commented 1 year ago

This information appears to be correct. You can make GUI on screen. For example, the music example on the routine. The main function of touch is to interact with people.

DeepCoreB4 commented 1 year ago
**Touch Fix!! This now works for me** 
changed to this lines of code...
    ft3267_read_pos(&touch_points_num, &p.x, &p.y);
    if (p.x != 0 && p.y != 0) { // this is the fix!!!
      data->point.x = p.x;
      data->point.y = p.y;
    }
euphi commented 1 year ago

I created a library for easier use here https://github.com/fablabnbg/TRGBArduinoSupport