Jump to content
RobG

2.2" Color LCD Booster Pack with Touch

Recommended Posts

v4 BoosterPacks use new display type, which has Y axis inverted when compared to the old one.

@@username, @@Rei Vilo, could you suggest changes to make this work?

 

I'm not sure to understand what "Y axis inverted" means.

 

The library supports all the four orientations with (0,0) always on the top left corner of the screen for each of the 4 orientations.

Share this post


Link to post
Share on other sites

I'm not sure to understand what "Y axis inverted" means.

 

The library supports all the four orientations with (0,0) always on the top left corner of the screen for each of the 4 orientations.

May be the energia lib I got is an order version, as it doesn't include the setOrientation function, and that's why I added myself, plus making the getTouch() function aware of the orientation setting.

 

For the "Y axis inverted", it just means when you touch the top, the Y result from getTouch() call is LCD_HEIGHT, and 0 when you touch the bottom (0,0 at bottom left corner). I tried both the energia lib, and the CCS one from Username, and both yield the same result. So it is very likely the v4 board got that part changed.

Share this post


Link to post
Share on other sites

The earlier versions of Robs board have the opposite direction for the touch panel.

 

I had to change some code to flip the y direction and tweak the calibration.

The old code works great with the old screens.

But the new screens need a few lines changed.

 

I'll dig out what i did just to throw it into the mix.

 

These are fantastic boosterpacks. Absolutely love 'em.

 

Cheers

 

PTB

Share this post


Link to post
Share on other sites
    if (z>TOUCH_TRIM) {
//        x0 = check(x0, 311, 1632);//Old Style Screens from RobG (Green PCB)
//        y0 = check(y0, 195, 1859);//Old Style Screens from RobG (Green PCB)
//        
//        x = map(x0, 311, 1632, 0, LCD_WIDTH);//Old Style Screens from RobG (Green PCB)
//        y = map(y0, 195, 1859, LCD_HEIGHT, 0);//Old Style Screens from RobG (Green PCB)


        x0 = check(x0, 156, 1874);              //Edited by PTB New Style Screens from RobG (Red PCB)
        y0 = check(y0, 120, 1859);              //Edited by PTB New Style Screens from RobG (Red PCB)
        x = map(x0, 156, 1874, 0, LCD_WIDTH);   //Edited by PTB New Style Screens from RobG (Red PCB)
        y = map(y0, 120, 1859, 0, LCD_HEIGHT);  //Edited by PTB New Style Screens from RobG (Red PCB)

        
        return true;
    }
    else {
        return false;
    }
}

Here's the 4 lines of code change (to the old code) at the bottom of LCD_Touch.cpp I did to get touch working for me on the newer screens

Share this post


Link to post
Share on other sites

@@PTB, Yeah this screen is great. It is strange that I just use the same (195,1859) range as the original lib y axis range for the x axis, and it works great, let me try the (156,1874) range tonight. And I think I just take it one step further by supporting the touch with all 4 screen orientation.

 

BTW, here is what I used the screen with...... So many threads about making the MSP430 reflow oven kit, but almost none of them available for purchase, so I just got to make my own. :)

 

1623345_765546480131143_917271151_n.jpg

Share this post


Link to post
Share on other sites

I realize I'm a little late on the scene... whatever happened to this project? The 43oh says they're out of stock, and your Tindie store doesn't seem to list them. I'd like to have one, possibly several.

Share this post


Link to post
Share on other sites

Ah. Ok. I have one of your non-touch 2.2" displays (with ?SD & no onboard SRAM); it's nicely built & does the job very well. A little slow, but that's because it's serial (and we really can't afford parallel with most MSP430s, we just can't spare enough pins).

 

If I could find a decent 2.2" resistive sensor overlay that I knew would fit my display, I'd add it to what I have & be done with it.

 

BTW... good to meet you, Rob.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×