Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Keypad RA8875 SDFileSystem mbed
Fork of RA8875_Demo by
Revision 2:2076d9cc6db9, committed 2014-01-17
- Comitter:
- WiredHome
- Date:
- Fri Jan 17 17:24:52 2014 +0000
- Parent:
- 1:29e9a07f768c
- Child:
- 3:ca6a1026c28e
- Commit message:
- Simplify the example, so it shows the program on the screen.
Changed in this revision
| RA8875.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/RA8875.lib Fri Jan 17 03:23:24 2014 +0000 +++ b/RA8875.lib Fri Jan 17 17:24:52 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/WiredHome/code/RA8875/#65f9f93b54dd +http://mbed.org/users/WiredHome/code/RA8875/#ed102fc442c4
--- a/main.cpp Fri Jan 17 03:23:24 2014 +0000
+++ b/main.cpp Fri Jan 17 17:24:52 2014 +0000
@@ -2,46 +2,51 @@
#include "RA8875.h"
-RA8875 lcd(p5, p6, p7, p12, NC, "tft"); // MOSI, MISO, SCK, /ChipSelect, /reset, name
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");
- lcd.Reset();
- lcd.Power(true); // display power is on, but the backlight is independent
- lcd.background(Black);
- lcd.foreground(Blue);
- lcd.cls();
- lcd.Backlight(1.0);
+ 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, "Raio RA8875 Display Controller Library\r\n");
- lcd.puts("This library uses a 4-wire SPI interface.\r\n\r\n"
- "lcd.circle( 400,15, 15, BrightRed);\r\n"
- "lcd.fillcircle( 440,15, 15, RGB(128,255,128));\r\n"
- "lcd.ellipse( 400,50, 25,10, BrightBlue);\r\n"
- "lcd.fillellipse( 440,50, 25,10, Blue);\r\n"
- "lcd.triangle( 400,75, 430,90, 410,100, Magenta);\r\n"
- "lcd.filltriangle( 440,100, 480,120, 450,130, Cyan);\r\n"
- "lcd.rect( 400,150, 479,200, Brown);\r\n"
- "lcd.fillrect( 410,160, 470,190, Pink);\r\n"
- "lcd.roundrect( 405,200, 450,255, 10,16, Yellow);\r\n"
- "lcd.fillroundrect(420,220, 435,250, 5,8, RGB(10,30,50));");
+ 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,15, 15, BrightRed);
- lcd.fillcircle( 440,15, 15, RGB(128,255,128));
- lcd.ellipse( 400,50, 25,10, BrightBlue);
- lcd.fillellipse( 440,50, 25,10, Blue);
- lcd.triangle( 400,75, 430,90, 410,100, Magenta);
- lcd.filltriangle( 440,100, 480,120, 450,130, Cyan);
- lcd.rect( 400,150, 479,200, Brown);
- lcd.fillrect( 410,160, 470,190, Pink);
- lcd.roundrect( 405,200, 450,255, 10,16, Yellow);
- lcd.fillroundrect(420,220, 435,250, 5,8, RGB(10,30,50));
+ 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)
;
}
