Toto je má konečná verze maturitního projektu
Dependencies: mbed mbed-rtos UTouch_vyrobek UniGraphic
Revision 0:6abf63b83992, committed 2021-12-06
- Comitter:
- smejky
- Date:
- Mon Dec 06 22:07:00 2021 +0000
- Child:
- 1:4dd546219e30
- Commit message:
- working;
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/UTouch.lib Mon Dec 06 22:07:00 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/rpocc/code/UTouch/#7c5a98a2d9ce
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/UniGraphic.lib Mon Dec 06 22:07:00 2021 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/teams/GraphicsDisplay/code/UniGraphic/#cafa6f431835
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/display.cpp Mon Dec 06 22:07:00 2021 +0000
@@ -0,0 +1,70 @@
+#include "mbed.h"
+#include "ILI9341.h"
+#include "UTouch.h"
+
+
+ILI9341 spi(SPI_8,320000000,PTD2,PTD3,PTD1,PTC12, PTC3, PTC2, "TFT",240,320);// mosi, miso, sclk, chip_select, reset, dc
+UTouch touch(D4,D9,D3,D2,D5);//clk,chip_select,MOSI,miso,irq(pripojeno je ale nevim co to dela)
+
+
+/*
+ v ILI9341.cpp zmeneny framerate ze 70 na 100, toto pomohlo problemu blikání displeje
+
+*/
+
+void Button(unsigned short int x0, unsigned short int y0,unsigned short int x1, unsigned short int y1,int color){
+ spi.fillrect(x0,y0,x1,y1,color);
+ //spi.fillrect(0,320,180,315,Purple);
+ //spi.fillrect(0,250,180,245,Purple);
+ //spi.fillrect(0,320,5,250,Purple);
+ while(1==1){
+ if (touch.DataAvailable())
+ {
+ if(touch.Read())
+ {
+ unsigned short int touch_y = touch.GetX();
+ unsigned short int touch_x = touch.GetY();
+ touch_x = touch_x - 10;
+ touch_y = touch_y + 10;
+ printf("%d \r\n",touch_y);
+ if ((touch_x >= x0 && touch_x <= x1)&&(touch_y >= y0 && touch_y <= y1)){
+ spi.fillrect(x0,y0,x1,y1,Black);
+ wait(500);
+
+ }
+ }
+
+ }
+
+ }
+
+}
+
+
+
+
+
+main(){
+ spi.background(White);
+ spi.cls();
+ spi.circle(240, 320, 20, Black);
+ touch.InitTouch();
+ touch.SetPrecision(PREC_EXTREME);
+ while(1){
+ if (touch.DataAvailable())
+ {
+ if(touch.Read())
+ {
+ unsigned short int touch_y = touch.GetX();
+ unsigned short int touch_x = touch.GetY();
+ touch_x = touch_x - 10;
+ touch_y = touch_y + 10;
+ printf("%d \r\n",touch_y);
+ spi.pixel(touch_x,touch_y,Blue);
+ }
+
+ }
+
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Dec 06 22:07:00 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc \ No newline at end of file