Demonstration of Soft Fonts

Dependencies:   mbed RA8875

Fork of RA8875_Demo by David Smart

Demo of Software based fonts mixed with RA8875 hosted fonts.

/media/uploads/WiredHome/softfont2.png

main.cpp

Committer:
WiredHome
Date:
2014-01-17
Revision:
2:2076d9cc6db9
Parent:
0:037b95a5cc85
Child:
3:ca6a1026c28e

File content as of revision 2:2076d9cc6db9:

#include "mbed.h"

#include "RA8875.h"


Serial pc(USBTX, USBRX);

int main()
{
    int i;
    
    pc.baud(460800);    // I like a snappy terminal, so crank it up!
    pc.printf("\r\nRA8875 Test - Build " __DATE__ " " __TIME__ "\r\n");
    
    pc.printf("Turning on display\r\n");
    RA8875 lcd(p5, p6, p7, p12, NC, "tft");    // MOSI, MISO, SCK, /ChipSelect, /reset, name

    //lcd.Power(true);  // display power is on, but the backlight is independent
    //lcd.Backlight(1.0);
    
    lcd.puts(0,0,
        "RA8875 lcd(p5, p6, p7, p12, NC, \"tft\");\r\n\r\n"
        "lcd.circle(       400,25,  25,  BrightRed);\r\n"
        "lcd.fillcircle(   400,25,  15,  RGB(128,255,128));\r\n"
        "lcd.ellipse(      440,75,  35,20, BrightBlue);\r\n"
        "lcd.fillellipse(  440,75,  25,10, Blue);\r\n"
        "lcd.triangle(     440,100, 475,110, 450,125, Magenta);\r\n"
        "lcd.filltriangle( 445,105, 467,111, 452,120, Cyan);\r\n"
        "lcd.rect(         400,130, 475,155,    Brown);\r\n"
        "lcd.fillrect(     405,135, 470,150,    Pink);\r\n"
        "lcd.roundrect(    410,160, 475,190, 10,8, Yellow);\r\n"
        "lcd.fillroundrect(415,165, 470,185,  5,3, Orange);\r\n"
        "lcd.line(         430,200, 460,230, RGB(0,255,0));\r\n"
        "for (i=0; i<=30; i+=5)\r\n"
        "    lcd.pixel(435+i,200+i, White);");

    lcd.circle(       400,25,  25,               BrightRed);
    lcd.fillcircle(   400,25,  15,               RGB(128,255,128));
    lcd.ellipse(      440,75,  35,20,            BrightBlue);
    lcd.fillellipse(  440,75,  25,10,            Blue);
    lcd.triangle(     440,100, 475,110, 450,125, Magenta);
    lcd.filltriangle( 445,105, 467,111, 452,120, Cyan);
    lcd.rect(         400,130, 475,155,          Brown);
    lcd.fillrect(     405,135, 470,150,          Pink);
    lcd.roundrect(    410,160, 475,190, 10,8,    Yellow);
    lcd.fillroundrect(415,165, 470,185,  5,3,    Orange);
    lcd.line(         430,200, 460,230,          RGB(0,255,0));
    for (i=0; i<=30; i+=5) 
        lcd.pixel(435+i,200+i, White);
    while (1)
        ;
}