Go Down

Topic: 2.8 tft ILI9325 touch menu's? (Read 5 times) previous topic - next topic

thecomputerguy

Hi I'm using a 2.8 tft ILI9325 touch screen with a arduino mega and RGB LEDs.

I have build a sweet PC fan controller with touch menu. All is well in that department.

But I've added RGB LEDs to the mix. So what I'm trying to figure out is there a way i can put a button on the screen that will change the
menu (i.e for RGB control) then push done button to go back to fan control screen. <- this will be easy enough just screenfill then rebuild.)

The part I think I can't seem to figure out how to code it to change the touch screen input area when menu changes.

I've searched pretty hard and havn't found much. Can anyone direct me somewhere that has tried this with any code examples. Or offer some input.

Would making one touch area a (not sure what it's called but) void function:
Void firstmenu()
{ blah blah touch areas do this etc..
}
http://www.youtube.com/watch?v=CuLpFTlA1Wg





thecomputerguy

Has anyone done a menu with this screen from adafruit?
http://www.adafruit.com/index.php?main_page=product_info&cPath=37&products_id=335

I do have a sdcard for it as well. I'm just tring to figure it out.

Where can i look who can i ask Anyone?

AndreMion

:D aonde eu encontro este menu?
estou construindo um projeto de Water Cooling com assistência de pastilhas de Peltier. Seria bem útil este menu!  8)

Docedison

I was thinking to use the edge middles and corners to point up/down right/left and diagonals for a 9 page menu and I had an idea for vector position location that I am going to try to write this month. I have 2 of the 3.2" displays from Electrodrogon (@17.00 ea US) W/o shield for a mega (6.00 more) and I will need at least 4 menu's. I'll try to post my results.

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

urthlight

#4
Dec 06, 2012, 02:03 am Last Edit: Dec 06, 2012, 02:22 am by urthlight Reason: 1
I think I have the same display from electrodragon. I bought them as backups while the adafruit displays were on back order. But then we got the last two 2.8 TFTs from Ada. So in a week or so I will try my hand at the cheap ones.
However I did find this
Code: [Select]


/**
* Touch Control Panel
* Copyright 2009 Jonathan Oxer <jon@oxer.com.au>
* Copyright 2009 Hugh Blemings <hugh@blemings.org>
*
* Reads touch coordinates on a Nintendo DS touch screen attached to an
* Arduino and compares them to defined hot zones representing buttons
* and sliders. If a touch occurs within a hot zone a matching event
* message is sent to the host via the serial port.
*
* Based on the ReadTouchscreen example included in the TouchScreen
* library.
*
*   www.practicalarduino.com/projects/touch-control-panel
*/
#include <TouchScreen.h>

TouchScreen ts(3, 1, 0, 2);

void setup()
{
  Serial.begin(38400);
}

void loop()
{
  int coords[2];
  ts.read(coords);
  Serial.print(coords[0]);
  Serial.print(",");
  Serial.print(coords[1]);

  if((coords[0] > 696) && (coords[0] < 866)
  && (coords[1] > 546) && (coords[1] < 831)) {
    Serial.print(", Fan ON");
  }
  if((coords[0] > 696) && (coords[0] < 866)
  && (coords[1] > 208) && (coords[1] < 476)) {
    Serial.print(", Fan OFF");
  }
  if((coords[0] > 420) && (coords[0] < 577)
  && (coords[1] > 540) && (coords[1] < 866)) {
    Serial.print(", Drapes OPEN");
  }
  if((coords[0] > 420) && (coords[0] < 577)
  && (coords[1] > 208) && (coords[1] < 476)) {
    Serial.print(", Drapes CLOSE");
  }
  if((coords[0] > 139) && (coords[0] < 327)
  && (coords[1] > 208) && (coords[1] < 866)) {
    Serial.print(", Illumination:");
    Serial.print(constrain(map(coords[1], 318, 756, 0, 100), 0, 100));
    Serial.print("%");
  }

  Serial.println();
  delay (100);
}


Go Up