David Smart
/
PUB_RA8875_Min
A minimal sample for the RA8875 display.
main.cpp@2:6948590d9b13, 2017-08-26 (annotated)
- Committer:
- WiredHome
- Date:
- Sat Aug 26 20:27:59 2017 +0000
- Revision:
- 2:6948590d9b13
- Parent:
- 1:55ebb2423290
- Child:
- 4:b3ffd7458e1a
RA8875 Minimum sample for the 480x272 display.; Uses mbed v146.; ; CAUTION: mbed v147 and newer seems to have badly affected stdio. Now lcd.printf() doesn't work properly.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
WiredHome | 2:6948590d9b13 | 1 | // Small test program |
WiredHome | 2:6948590d9b13 | 2 | #include "mbed.h" // Working: v146, not fully working: v147 |
WiredHome | 2:6948590d9b13 | 3 | #include "RA8875.h" // Working: v149 |
WiredHome | 0:8446f99d40a0 | 4 | RA8875 lcd(p5, p6, p7, p12, NC, "tft"); |
WiredHome | 0:8446f99d40a0 | 5 | |
WiredHome | 0:8446f99d40a0 | 6 | int main() |
WiredHome | 0:8446f99d40a0 | 7 | { |
WiredHome | 2:6948590d9b13 | 8 | lcd.init(480,272,16,100); |
WiredHome | 0:8446f99d40a0 | 9 | lcd.printf("printing 3 x 2 = %d", 3*2); |
WiredHome | 0:8446f99d40a0 | 10 | lcd.circle( 400,25, 25, BrightRed); |
WiredHome | 0:8446f99d40a0 | 11 | lcd.fillcircle( 400,25, 15, RGB(128,255,128)); |
WiredHome | 0:8446f99d40a0 | 12 | lcd.ellipse( 440,75, 35,20, BrightBlue); |
WiredHome | 0:8446f99d40a0 | 13 | lcd.fillellipse( 440,75, 25,10, Blue); |
WiredHome | 0:8446f99d40a0 | 14 | lcd.triangle( 440,100, 475,110, 450,125, Magenta); |
WiredHome | 0:8446f99d40a0 | 15 | lcd.filltriangle( 445,105, 467,111, 452,120, Cyan); |
WiredHome | 0:8446f99d40a0 | 16 | lcd.rect( 400,130, 475,155, Brown); |
WiredHome | 0:8446f99d40a0 | 17 | lcd.fillrect( 405,135, 470,150, Pink); |
WiredHome | 0:8446f99d40a0 | 18 | lcd.roundrect( 410,160, 475,190, 10,8, Yellow); |
WiredHome | 0:8446f99d40a0 | 19 | lcd.fillroundrect(415,165, 470,185, 5,3, Orange); |
WiredHome | 0:8446f99d40a0 | 20 | lcd.line( 430,200, 460,230, RGB(0,255,0)); |
WiredHome | 0:8446f99d40a0 | 21 | for (int i=0; i<=30; i+=5) |
WiredHome | 0:8446f99d40a0 | 22 | lcd.pixel(435+i,200+i, White); |
WiredHome | 0:8446f99d40a0 | 23 | } |