Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

ILI9341 rotation display
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ILI9341 rotation display

by jimwang90 on Thu Feb 04, 2016 4:05 pm

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

}

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

Re: ILI9341 rotation display

by jimwang90 on Thu Feb 04, 2016 4:34 pm

OK works, forget CS_ACTIVE;

thans

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

Please be positive and constructive with your questions and comments.