ILI9341 rotation display

Our weekly LIVE video chat. Every Wednesday at 8pm ET!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jimwang90
 
Posts: 41
Joined: Sat Jan 23, 2016 10:13 pm

ILI9341 rotation display

Post by jimwang90 »

Hi, my use ILI9341 breakout board with my design that is MSP430 system. I can display the TEXT now, but when I try to display the TEXT on different direction, it can not rotation, my code as follow that is from your sample code and I modify it, the rotation changed from 0-3, but no rotation happen:

void setRotation()
{
unsigned int t;

rotation = rotation & 3;
switch(rotation)
{
case 0:
case 2:
_width = 240; //WIDTH;
_height = 320; //HEIGHT;
break;
case 1:
case 3:
_width = 320; //HEIGHT;
_height = 240; //WIDTH;
break;
}

switch (rotation)
{
case 2:
t = 0x40 | 0x08 ;//ILI9341_MADCTL_MX | ILI9341_MADCTL_BGR;
break;
case 3:
t = 0x20 | 0x08; //ILI9341_MADCTL_MV | ILI9341_MADCTL_BGR;
break;
case 0:
t = 0x80 | 0x08; //ILI9341_MADCTL_MY | ILI9341_MADCTL_BGR;
break;
case 1:
t = 0x40 | 0x80 | 0x20 | 0x08 ; //ILI9341_MADCTL_MX | ILI9341_MADCTL_MY | ILI9341_MADCTL_MV | ILI9341_MADCTL_BGR;
break;
}
writeRegister8inline(0x36, t );
// MADCTL
// For 9341, init default full-screen address window:
setAddrWindow(0, 0, _width - 1, _height - 1); // CS_IDLE happens here

}

User avatar
jimwang90
 
Posts: 41
Joined: Sat Jan 23, 2016 10:13 pm

Re: ILI9341 rotation display

Post by jimwang90 »

OK works, forget CS_ACTIVE;

thans

Locked
Please be positive and constructive with your questions and comments.

Return to “Ask an Engineer! VIDEO CHAT (closed)”