KrisKasprzak / ILI9341_t3_controls

Graphical slider controls for TFT LCD type displays
30 stars 65 forks source link

problem for compiling on teensy 4.0 #1

Closed benwadub closed 2 years ago

benwadub commented 2 years ago

hi, i d like to test your library but I can t compile it on teensy 4.0 I got this error


Users/benoitparisot/Documents/Arduino/libraries/UTouch-master/UTouch.cpp: In member function 'void UTouch::InitTouch(byte)':
/Users/benoitparisot/Documents/Arduino/libraries/UTouch-master/UTouch.cpp:57:8: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
  P_CLK = portOutputRegister(digitalPinToPort(T_CLK));
        ^
/Users/benoitparisot/Documents/Arduino/libraries/UTouch-master/UTouch.cpp:59:7: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
  P_CS = portOutputRegister(digitalPinToPort(T_CS));
       ^
/Users/benoitparisot/Documents/Arduino/libraries/UTouch-master/UTouch.cpp:61:8: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
  P_DIN = portOutputRegister(digitalPinToPort(T_DIN));
        ^
/Users/benoitparisot/Documents/Arduino/libraries/UTouch-master/UTouch.cpp:63:9: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
  P_DOUT = portInputRegister(digitalPinToPort(T_DOUT));
         ^
/Users/benoitparisot/Documents/Arduino/libraries/UTouch-master/UTouch.cpp:65:8: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
  P_IRQ = portInputRegister(digitalPinToPort(T_IRQ));
        ^```
any idea how to fix it please? thanks
KrisKasprzak commented 2 years ago

Yes, the issue is the touch lib. This UTouch, was never updated for the Teensy 4.0. I'm not sure who the author is but, I would be good if you filed an issue against that library. The best lib to use for the Teensy is the XPT2046 and has support for the 4.0. If I knew about this library when I created this lib, I would surely have used it. It is found at: GitHub - PaulStoffregen/XPT2046_Touchscreen: Touchscreen Arduino Library for XPT2046 Touch Controller Chip

|

GitHub - PaulStoffregen/XPT2046_Touchscreen: Touchscreen Arduino Library...

Touchscreen Arduino Library for XPT2046 Touch Controller Chip - GitHub - PaulStoffregen/XPT2046_Touchscreen: Tou... |

|

|

This is an SPI based library so the connections will be T_IRQ (any valid pin on the Teensy, 0 should be fine)T_DO Connect to MISO, the same MISO pin as the display connects toT_DIN Connect to MOSI, the same MOSI pin as the display connects toT_CS connect to any valid pin on Teensy (1 should be fine)T_CLK connect to the SPI clock pin, same pin as the display SCK then initialize with:XPT2046_Touchscreen ts(CS_PIN, TIRQ_PIN); you should be able to omit connecting the touch T_IRQ, but initiallize with XPT2046_Touchscreen ts(CS_PIN);  // Param 2 - NULL - No interrupts

Using this library a few other things will need to be changed in handling the screen press. The library has examples, if you get stuck let me know. Kris

On Tuesday, November 30, 2021, 03:54:50 PM CST, benwadub ***@***.***> wrote:  

hi, i d like to test your library but I can t compile it on teensy 4.0 I got this error Users/benoitparisot/Documents/Arduino/libraries/UTouch-master/UTouch.cpp: In member function 'void UTouch::InitTouch(byte)': /Users/benoitparisot/Documents/Arduino/libraries/UTouch-master/UTouch.cpp:57:8: error: cannot convert 'volatile uint32_t {aka volatile long unsigned int}' to 'volatile uint8_t {aka volatile unsigned char}' in assignment P_CLK = portOutputRegister(digitalPinToPort(T_CLK)); ^ /Users/benoitparisot/Documents/Arduino/libraries/UTouch-master/UTouch.cpp:59:7: error: cannot convert 'volatile uint32_t {aka volatile long unsigned int}' to 'volatile uint8_t {aka volatile unsigned char}' in assignment P_CS = portOutputRegister(digitalPinToPort(T_CS)); ^ /Users/benoitparisot/Documents/Arduino/libraries/UTouch-master/UTouch.cpp:61:8: error: cannot convert 'volatile uint32_t {aka volatile long unsigned int}' to 'volatile uint8_t {aka volatile unsigned char}' in assignment P_DIN = portOutputRegister(digitalPinToPort(T_DIN)); ^ /Users/benoitparisot/Documents/Arduino/libraries/UTouch-master/UTouch.cpp:63:9: error: cannot convert 'volatile uint32_t {aka volatile long unsigned int}' to 'volatile uint8_t {aka volatile unsigned char}' in assignment P_DOUT = portInputRegister(digitalPinToPort(T_DOUT)); ^ /Users/benoitparisot/Documents/Arduino/libraries/UTouch-master/UTouch.cpp:65:8: error: cannot convert 'volatile uint32_t {aka volatile long unsigned int}' to 'volatile uint8_t {aka volatile unsigned char}' in assignment P_IRQ = portInputRegister(digitalPinToPort(T_IRQ)); ^``` any idea how to fix it please? thanks — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

benwadub commented 2 years ago

thanks I saw that your library works nicely on teensy 4.0 and 4.1 what I need is only a library to draw and not using the touch of ili9341 I ll try to understand your library, it seems to be a good starting point for my midi controller! do you know a way to draw the position of rotary encoders quite easily as I m a beginner at coding.

KrisKasprzak commented 2 years ago

Several ways to do it, it all depends of what you want the display to look like.

Thanks. Kris

On Dec 18, 2021, at 2:00 PM, benwadub @.***> wrote:

 thanks I saw that your library works nicely on teensy 4.0 and 4.1 what I need is only a library to draw and not using the touch of ili9341 I ll try to understand your library, it seems to be a good starting point for my midi controller! do you know a way to draw the position of rotary encoders quite easily as I m a beginner at coding.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.

benwadub commented 2 years ago

I d like to have a simple arc that is unfilled when my midi value is zero and filled when my midi value is 127 I need to display 8 encoders on the display