Testni program za Banggood displej

Dependencies:   SPI_TFT_ILI9341 TFT_fonts mbed

Files at this revision

API Documentation at this revision

Comitter:
esokic
Date:
Wed Mar 09 09:14:00 2016 +0000
Commit message:
Testni program za Banggood displej (US 2016)

Changed in this revision

SPI_TFT_ILI9341.lib Show annotated file Show diff for this revision Revisions of this file
TFT_fonts.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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SPI_TFT_ILI9341.lib	Wed Mar 09 09:14:00 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/dreschpe/code/SPI_TFT_ILI9341/#b2b3e5430f81
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TFT_fonts.lib	Wed Mar 09 09:14:00 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/dreschpe/code/TFT_fonts/#76774250fcec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Mar 09 09:14:00 2016 +0000
@@ -0,0 +1,51 @@
+#include "mbed.h"
+#define dp23 P0_0
+
+
+#include "stdio.h"
+#include "SPI_TFT_ILI9341.h"
+#include "string"
+#include "Arial12x12.h"
+#include "Arial24x23.h"
+#include "Arial28x28.h"
+#include "font_big.h"
+//#include "SDFileSystem.h"
+
+SPI_TFT_ILI9341 TFT(dp2,dp1,dp6,dp24,dp23,dp25,"TFT"); // mosi, miso, sclk, cs, reset, dc
+
+int main()
+{
+    int i=0;
+    //Inicijalizacija;
+    TFT.claim(stdout);
+    TFT.set_orientation(1);
+    TFT.background(Blue);     // set background to black
+    TFT.foreground(White);    // set chars to white
+    TFT.cls();                // clear the screen
+
+    while(1) {
+        TFT.set_font((unsigned char*) Arial28x28);
+        TFT.locate(10,10);
+        printf("Mi volimo US!");
+
+        wait(2);
+        //Crtanje linija
+        TFT.line(0,0,100,0,Green);
+        TFT.line(0,0,0,200,Green);
+        TFT.line(0,0,100,200,Green);
+
+        //Crtanje dijagrama piksel po poksel
+        double s;
+        for (i=0; i<320; i++) {
+            s =20 * sin((long double) i / 10 );
+            TFT.pixel(i,100 + (int)s ,Red);
+        }
+
+        wait(2);
+        TFT.cls();
+
+    }
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Mar 09 09:14:00 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/87f2f5183dfb
\ No newline at end of file