ILI9325 based GR_SAKURA LCD Shield

Dependencies:   TFTLCD_8bit mbed-src mbed

main.cpp

Committer:
ksekimoto
Date:
2015-01-03
Revision:
9:2d26ff43f069
Parent:
8:d4fc30048585

File content as of revision 9:2d26ff43f069:

#include "mbed.h"
#include "ili9328.h"

// GR_PEACH_ILI9325
// Imported from KL25Z_ILI9325

// prepare the data bus for writing commands and pixel data
//BusOut dataBus( p30, p29, p28, p27, p26, p25, p24, p23, p22, p21, p20, p19, p18, p17, p16, p15 ); // 16 pins
BusOut dataBus( P2_7, P2_6, P2_5, P2_4, P2_3, P2_2, P2_1, P2_0 ); // 16 pins
// create the lcd instance
ILI9328_LCD lcd( P5_7, P5_4, P5_6, P5_5, &dataBus , NC, P5_3); // control pins and data bus
//CS, RESET, RS, WR
int main()
{
    int ii,height,width;
    
    height = lcd.GetHeight();
    width = lcd.GetWidth();
    // initialize display - place it in standard portrait mode and set background to black and
    //                      foreground to white color.
    lcd.Initialize();
    // set current font to the smallest 8x12 pixels font.
//    lcd.SetFont( Font8x12 );
    // print something on the screen
    lcd.Print( "Hello, World!", CENTER, 50); // align text to center horizontally and use starndard colors

    wait(2);
   
    lcd.ClearScreen();

//    for(ii=0;ii<240;ii++)
//    height = lcd.GetHeight();
//    for(ii=0;ii<lcd.GetHeight1();ii++)
    for(ii=0;ii<width;ii++)
    {
//        lcd.DrawLine(0, 0, lcd.GetWidth1(), ii,COLOR_GREEN);
        lcd.DrawLine(0, 0, height, ii,COLOR_GREEN);
//        lcd.DrawLine(0, 0, 320, ii,COLOR_GREEN);
        ii = ii+10;    
    }
    wait(2);

    lcd.DrawCircle(height/4, width/4, 20, COLOR_GREEN);
    wait(2);

    lcd.FillCircle(height/2, width/2, 50, COLOR_GREEN);
    wait(2);

    lcd.FillTriangle(height/4, width/4,(height/4)+20, (width/4)+40,(height/4)-20, (width/4)+40, COLOR_RED);


    while ( 1 ) { }
}