Chirurgia spinală minim invazivă
Chirurgia spinală minim invazivă oferă pacienților oportunitatea unui tratament eficient, permițându-le o recuperare ultra rapidă și nu în ultimul rând minimizând leziunile induse chirurgical. Echipa noastră utilizează un spectru larg de tehnici minim invazive, din care enumerăm câteva: endoscopia cu variantele ei (transnazală, transtoracică, transmusculară, etc), microscopul operator, abordurile trans tubulare și nu în ultimul rând infiltrațiile la toate nivelurile coloanei vertebrale. www.neurohope.ro |
Probleme Touchscreen Arduino Mega + TFT ILI9481 480x320
Last Updated: Feb 11 2020 11:39, Started by
AlexandruSD
, Feb 10 2020 23:06
·
0
#1
Posted 10 February 2020 - 23:06
Salut. Am și eu o problemă cu ecranul TFT 480x320 (ILI9481 driver). Acesta este conectat direct la Arduino MEGA, am instalat bibliotecile UTFT și URTouch. Când folosesc unul din exemple date, afișează perfect totul, dar touchscreenul nu funcționează. Ar mai trebui să instalez ceva vreo bibliotecă sau vreun driver? Vă mulțumesc.
Codul este următorul: // URTouch_QuickPaint // Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved // web: http://www.RinkyDinkElectronics.com/ // // This program is a quick demo of how to use the library. // // This program requires the UTFT library and a display // module with at least 320x240 pixels resolution. // // It is assumed that the display module is connected to an // appropriate shield or that you know how to change the pin // numbers in the setup. // #include <UTFT.h> #include <URTouch.h> // Initialize display // ------------------ // Set the pins to the correct ones for your development board // ----------------------------------------------------------- // Standard Arduino Uno/2009 Shield : <display model>,19,18,17,16 // Standard Arduino Mega/Due shield : <display model>,38,39,40,41 // CTE TFT LCD/SD Shield for Arduino Due : <display model>,25,26,27,28 // Teensy 3.x TFT Test Board : <display model>,23,22, 3, 4 // ElecHouse TFT LCD/SD Shield for Arduino Due : <display model>,22,23,31,33 // // Remember to change the model parameter to suit your display module! UTFT myGLCD(ILI9481,38,39,40,41); // Initialize touchscreen // ---------------------- // Set the pins to the correct ones for your development board // ----------------------------------------------------------- // Standard Arduino Uno/2009 Shield : 15,10,14, 9, 8 // Standard Arduino Mega/Due shield : 6, 5, 4, 3, 2 // CTE TFT LCD/SD Shield for Arduino Due : 6, 5, 4, 3, 2 // Teensy 3.x TFT Test Board : 26,31,27,28,29 // ElecHouse TFT LCD/SD Shield for Arduino Due : 25,26,27,29,30 // URTouch myTouch( 6, 5, 4, 3, 2); // Declare which fonts we will be using extern uint8_t BigFont[]; int color = 0; word colorlist[] = {VGA_WHITE, VGA_BLACK, VGA_RED, VGA_BLUE, VGA_GREEN, VGA_FUCHSIA, VGA_YELLOW, VGA_AQUA}; int bsize = 4; void drawColorMarkerAndBrushSize(int col) { myGLCD.setColor(VGA_BLACK); myGLCD.fillRect(25, 0, 31, 239); myGLCD.fillRect(myGLCD.getDisplayXSize()-31, 161, myGLCD.getDisplayXSize()-1, 191); myGLCD.setColor(VGA_WHITE); myGLCD.drawPixel(25, (col*30)+15); for (int i=1; i<7; i++) myGLCD.drawLine(25+i, ((col*30)+15)-i, 25+i, ((col*30)+15)+i); if (color==1) myGLCD.setColor(VGA_WHITE); else myGLCD.setColor(colorlist[col]); if (bsize==1) myGLCD.drawPixel(myGLCD.getDisplayXSize()-15, 177); else myGLCD.fillCircle(myGLCD.getDisplayXSize()-15, 177, bsize); myGLCD.setColor(colorlist[col]); } void setup() { myGLCD.InitLCD(); myGLCD.clrScr(); myGLCD.setFont(BigFont); myTouch.InitTouch(); myTouch.setPrecision(PREC_HI); myGLCD.setColor(VGA_WHITE); myGLCD.drawLine(32,0,32,myGLCD.getDisplayYSize()-1); myGLCD.drawLine(myGLCD.getDisplayXSize()-32,0,myGLCD.getDisplayXSize()-32,myGLCD.getDisplayYSize()-1); myGLCD.print("C", myGLCD.getDisplayXSize()-24, 8); myGLCD.print("L", myGLCD.getDisplayXSize()-24, 24); myGLCD.print("E", myGLCD.getDisplayXSize()-24, 40); myGLCD.print("A", myGLCD.getDisplayXSize()-24, 56); myGLCD.print("R", myGLCD.getDisplayXSize()-24, 72); myGLCD.print("+", myGLCD.getDisplayXSize()-24, 136); myGLCD.print("-", myGLCD.getDisplayXSize()-24, 200); myGLCD.fillRect(myGLCD.getDisplayXSize()-32,96,myGLCD.getDisplayXSize()-1,128); myGLCD.drawLine(myGLCD.getDisplayXSize()-32,160,myGLCD.getDisplayXSize()-1,160); myGLCD.drawLine(myGLCD.getDisplayXSize()-32,192,myGLCD.getDisplayXSize()-1,192); myGLCD.drawLine(myGLCD.getDisplayXSize()-32,224,myGLCD.getDisplayXSize()-1,224); for (int i=0; i<8; i++) { myGLCD.setColor(colorlist[i]); myGLCD.fillRect(0, (i*30), 24, (((i+1)*30)-1)); } drawColorMarkerAndBrushSize(color); } void loop() { long x, y; while (myTouch.dataAvailable() == true) { myTouch.read(); x = myTouch.getX(); y = myTouch.getY(); if ((x!=-1) and (y!=-1)) { if (x>(31+bsize) and (x<myGLCD.getDisplayXSize()-(31+bsize))) { if (bsize==1) myGLCD.drawPixel(x, y); else myGLCD.fillCircle(x, y, bsize); } else { if (x<(30+bsize)) { if (y<240) { color = y / 30; drawColorMarkerAndBrushSize(color); while (myTouch.dataAvailable()) {}; delay(50); } } else { if (y<96) { myGLCD.setColor(VGA_BLACK); myGLCD.fillRect(33, 0, myGLCD.getDisplayXSize()-33, myGLCD.getDisplayYSize()-1); myGLCD.setColor(colorlist[color]); } if ((y>128) and (y<160)) { if (bsize<7) { bsize++; drawColorMarkerAndBrushSize(color); while (myTouch.dataAvailable()) {}; delay(50); } } if ((y>160) and (y<192)) { bsize=4; drawColorMarkerAndBrushSize(color); while (myTouch.dataAvailable()) {}; delay(50); } if ((y>192) and (y<224)) { if (bsize>1) { bsize--; drawColorMarkerAndBrushSize(color); while (myTouch.dataAvailable()) {}; delay(50); } } } } } } } |
#2
Posted 11 February 2020 - 09:57
Cele 2 librarii sint compatibile cu acest model ?
Incearca si alte librarii, eu am gasit cel putin 2 (la una scria clar ca e comatibila, cealalta avea niste producatori, n-am stat sa caut exact modelul) Conexiunile sint facute corect ? Mai verifica o data. |
#3
Posted 11 February 2020 - 11:39
Da, conexiunile sunt bune, ecranul fiind pus direct pe Arduino Mega, la pinii 22-54. Sunt compatibile, am văzut videoclipuri pe yt cu librăriile acestea, și functiona ecranul touch.
|
Anunturi
▶ 0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users