Show Posts
Pages: 1 ... 59 60 [61] 62 63 ... 251
901  Using Arduino / Programming Questions / Re: Bluetooth as a push button on: April 01, 2014, 01:03:52 pm
Quote
my BluetoothData variable is set as an integer
Your bluetooth module should be sending out chars, not ints.
But I can see where the problem is and it's with this line here, "int BluetoothData; // the data given from Computer"
BluetoothData should be type char not int. In fact you're already comparing it to chars in your IF statements.
Quote
BluetoothData == 's'

All you need to do now is make it so a space char is sent out when no button/key is pressed.
902  Using Arduino / Programming Questions / Re: I really need some help on this project on: March 31, 2014, 05:54:31 pm
You can changed these to boolean because you are only checking for a 1 or 0.
Quote
  int S0 = digitalRead(3);//digitalRead(2);
  int S1 = digitalRead(3);
  int S2 = digitalRead(4);
  int S3 = digitalRead(5);
  int S4 = digitalRead(13);
  int S5 = digitalRead(12);
  int S6 = digitalRead(11);
  int S7 = digitalRead(8 );
  int S8 = digitalRead(6);
  int S9 = digitalRead(6);

And you can also do this.
if(S0 & S1 & S2 & S3 & S4 & S5 & S6 & S7 & S8 & S9)  // this will be true if all are true / 1

You can also get creative with a FOR loop and a little multiplication. Also instead of using S0 ... S9, you can use an array.
903  Using Arduino / Programming Questions / Re: I really need some help on this project on: March 31, 2014, 05:37:37 pm
You really need to clean up your code. Please format it with CTRL+T.

One thing that will help us, is comments. What sensors do what? Which ones are the left side, which are the right side and what is the center?

This is not needed if you know what sensors are what variable and your can split this into three functions. Left side, right side and center.
Quote
(S0==1 && S1==1 && S2==1 && S3==1 && S4==1 && S5==1 && S6==1 && S7==1 && S8==1 && S9==1) || (S0==0 && S1==0 && S2==0 && S3==0 && S4==0 && S5==0 && S6==0 && S7==0 && S8==0 && S9==0))
904  Development / Other Software Development / Re: New TFT Extension Library on: March 30, 2014, 04:18:58 pm
Here are the times for the radio button color functions.
Code:
#include <ITDB02_Graph16.h>
#include <ITDB02_Touch.h>
#include <TFT_Extension_old.h>
#include <math.h>
// Declare which fonts we will be using
extern uint8_t SmallFont[];

//myGLCD(RS,WR,CS,RST,ALE,mode);
ITDB02 myGLCD(A1,A2,A0,A3,A5,ITDB32S);
//myTouch(TCLK,TCS,DIN,DOUT,IRQ);
ITDB02_Touch  myTouch(13,10,11,12,A4);
TFT_Extension_old myTFT(&myGLCD, &myTouch, LANDSCAPE);

unsigned long timeStart, timeCollect[13];
char * functs[13] = {
  "Set RBO color: ", "Set RCBO color: ", "Set RBT color: ", "Set RCBT color: ",
  "Set RBUT color: ", "Set RCBUT color: ", "Set RBO_BG color: ", "Set RCBO_BG color: ",
  "Set RBT_BG color: ","Set RCBT_BG color: ", "Set RBUT_BG color: ","Set RCBUT_BG color: ",
  "Total Time: "};
void setup()
{
  myGLCD.InitLCD(LANDSCAPE);
  myGLCD.clrScr();
  myGLCD.setFont(SmallFont);
  myTouch.InitTouch(LANDSCAPE);
  myTouch.setPrecision(PREC_LOW);
  Serial1.begin(115200);
  startup();
}

void loop() {
}

void startup()
{
  myGLCD.setColor(255, 0, 0);//red box fill
  myGLCD.fillRect(0, 0, 319, 13);//text box
  myGLCD.setColor(255, 255, 255);//text color White
  myGLCD.setBackColor(255, 0, 0);//background of text red
  myGLCD.drawLine(0, 14, 319, 14);
  myGLCD.print("LatchButtons", CENTER, 1);
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.print("Touch screen to start", CENTER, 119);
  myGLCD.clrScr();
  myGLCD.print("Latches", CENTER, 50);
  myGLCD.print("Buttons", CENTER, 170);

  timeStart = micros();
  myTFT.RB_Outer_Color(0,1,WHITE);
  timeCollect[0] = micros() - timeStart;
 
  timeStart = micros();
  myTFT.RCB_Outer_Color(0,1,WHITE);
  timeCollect[1] = micros() - timeStart;
 
  timeStart = micros();
  myTFT.RB_Toggled_Color(0,1,WHITE);
  timeCollect[2] = micros() - timeStart;
 
  timeStart = micros();
  myTFT.RCB_Toggled_Color(0,1,WHITE);
  timeCollect[3] = micros() - timeStart;
 
  timeStart = micros();
  myTFT.RB_Untoggled_Color(0,1,WHITE);
  timeCollect[4] = micros() - timeStart;
 
  timeStart = micros();
  myTFT.RCB_Untoggled_Color(0,1,WHITE);
  timeCollect[5] = micros() - timeStart;
 
  timeStart = micros();
  myTFT.RB_Outer_Color_By_Group(1, GREEN);
  timeCollect[6] = micros() - timeStart;
 
  timeStart = micros();
  myTFT.RCB_Outer_Color_By_Group(1, GREEN);
  timeCollect[7] = micros() - timeStart;
 
  timeStart = micros();
  myTFT.RB_Toggled_Color_By_Group(1, GREEN);
  timeCollect[8] = micros() - timeStart;
 
  timeStart = micros();
  myTFT.RCB_Toggled_Color_By_Group(1, GREEN);
  timeCollect[9] = micros() - timeStart;
 
  timeStart = micros();
  myTFT.RB_Untoggled_Color_By_Group(1, GREEN);
  timeCollect[10] = micros() - timeStart;
 
  timeStart = micros();
  myTFT.RCB_Untoggled_Color_By_Group(1, GREEN);
  timeCollect[11] = micros() - timeStart;
  timeCollect[12] = micros() - timeCollect[0];
  myGLCD.clrScr();
  for(byte idx = 0; idx < 13; idx++)
  {
    myGLCD.print(functs[idx], 0, idx * 16);
    myGLCD.printNumF((float(timeCollect[idx]) / 1000.00),6, 200, idx * 16 );
  } 
}

Output:
Quote
Set RBO color:  .00799
Set RCBO color: 0.00799
Set RBT color: 0.00799
Set RCBT color: 0.00799
Set RBUT color: 0.00799
Set RCBUT color: 0.00799
Set RBO_BG color: 0.00399
Set RCBO_BG color:  0.00799
Set RBT_BG color: 0.00399
Set RCBT_BG color: 0.00399
Set RBUT_BG color: 0.00799
Set RCBUT_BG color: 0.00399
Total Time: 0.07988
905  Development / Other Software Development / Re: New TFT Extension Library on: March 30, 2014, 03:19:26 pm
Both types of latching buttons.

Code:
#include <ITDB02_Graph16.h>
#include <ITDB02_Touch.h>
#include <TFT_Extension_old.h>
#include <math.h>
// Declare which fonts we will be using
extern uint8_t SmallFont[];

//myGLCD(RS,WR,CS,RST,ALE,mode);
ITDB02 myGLCD(A1,A2,A0,A3,A5,ITDB32S);
//myTouch(TCLK,TCS,DIN,DOUT,IRQ);
ITDB02_Touch  myTouch(13,10,11,12,A4);
TFT_Extension_old myTFT(&myGLCD, &myTouch, LANDSCAPE);

unsigned long timeStart, timeCollect[9];
char * functs[11] = {
  "Set TC color: ", "Setup LC color: ", "Set TB color: ", "Set LB color: ","TC_Draw: ",
  "LC_Draw: ","TB_Draw: ","LB_Draw: ", "Total Time: "};

boolean last = LOW, latch = false;

void setup()
{
  myGLCD.InitLCD(LANDSCAPE);
  myGLCD.clrScr();
  myGLCD.setFont(SmallFont);
  myTouch.InitTouch(LANDSCAPE);
  myTouch.setPrecision(PREC_LOW);
  Serial1.begin(115200);
  startup();
}

void loop() {}

void startup()
{
  myGLCD.setColor(255, 0, 0);//red box fill
  myGLCD.fillRect(0, 0, 319, 13);//text box
  myGLCD.setColor(255, 255, 255);//text color White
  myGLCD.setBackColor(255, 0, 0);//background of text red
  myGLCD.drawLine(0, 14, 319, 14);
  myGLCD.print("LatchButtons", CENTER, 1);
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.print("Touch screen to start", CENTER, 119);
  myGLCD.clrScr();
  myGLCD.print("Latches", CENTER, 50);
  myGLCD.print("Buttons", CENTER, 170);
 
  timeStart = micros();
  myTFT.SetTouchCircleColors(0, ORANGE, PURPLE, FILL);        // ID number, Pressed Color, Released Color, FILL/NOFILL)
  timeCollect[0] = micros() - timeStart;
  timeStart = micros();
  myTFT.SetLatchCircleColors(1, WHITE, CYAN, FILL);          // ID number, Latched Color, UnLatched Color, FILL/NOFILL)
  timeCollect[1] = micros() - timeStart;
  timeStart = micros();
  myTFT.SetTouchButtonColors(0, GREEN, RED, FILL, ROUNDED);   // ID number, Pressed Color, Released Color, FILL/NOFILL,ROUNDED/NOTROUNDED)
  timeCollect[2] = micros() - timeStart;
  timeStart = micros();
  myTFT.SetLatchButtonColors(1, BLUE, YELLOW, FILL, ROUNDED); // ID number, Latched Color, UnLatched Color, FILL/NOFILL, ROUNDED/NOTROUNDED)
  timeCollect[3] = micros() - timeStart;
  getButton();
  myGLCD.clrScr();
  for(byte idx = 0; idx < 9; idx++)
  {
   myGLCD.print(functs[idx], 0, idx * 20);
   myGLCD.printNumF(float(timeCollect[idx]) / 1000.00,3, 200, idx * 20 );
  } 
}

void getButton()
{
  timeStart = micros();
  myTFT.TouchCircle_Draw(55,180,50,0); // (x,y,radius, ID number)
  timeCollect[4] = micros() - timeStart;
  timeStart = micros();
  myTFT.LatchCircle_Draw(265,55,50,1); // (x,y,radius, ID number)
  timeCollect[5] = micros() - timeStart;
  timeStart = micros();
  myTFT.TouchButton_Draw(220,135,310,225,0);// (x1,y1,x2,y2, ID number)
  timeCollect[6] = micros() - timeStart;
  timeStart = micros();
  myTFT.LatchButton_Draw(10,10,100,100,1);// (x1,y1,x2,y2, ID number)
  timeCollect[7] = micros() - timeStart;
  timeCollect[8] = micros() - timeCollect[0];
}

Output time in milliseconds
Quote
Set TC color: 0.011
Setup LC color: 0.007
Set TB color: 0.011
Set LB color: 0.011
TC_Draw: 1795.851
LC_Draw: 1795.851
TB_Draw: 167.507
LB_Draw: 167.515
Total Time: 3923.999

Both types of triangles:
Code:
#include <ITDB02_Graph16.h>
#include <ITDB02_Touch.h>
#include <TFT_Extension_old.h>
#include <math.h>
// Declare which fonts we will be using
extern uint8_t SmallFont[];

//myGLCD(RS,WR,CS,RST,ALE,mode);
ITDB02 myGLCD(A1,A2,A0,A3,A5,ITDB32S);
//myTouch(TCLK,TCS,DIN,DOUT,IRQ);
ITDB02_Touch  myTouch(13,10,11,12,A4);
TFT_Extension_old myTFT(&myGLCD, &myTouch, LANDSCAPE);

unsigned long timeStart, timeCollect[5];
char * functs[11] = {
  "Set TT color: ", "Setup LT color: ", "TT_Draw: ",
  "LT_Draw: ", "Total Time: "};

void setup()
{
  myGLCD.InitLCD(LANDSCAPE);
  myGLCD.clrScr();
  myGLCD.setFont(SmallFont);
  myTouch.InitTouch(LANDSCAPE);
  myTouch.setPrecision(PREC_LOW);
  Serial1.begin(115200);
  startup();
}

void loop() {}

void startup()
{
  myGLCD.setColor(255, 0, 0);//red box fill
  myGLCD.fillRect(0, 0, 319, 13);//text box
  myGLCD.setColor(255, 255, 255);//text color White
  myGLCD.setBackColor(255, 0, 0);//background of text red
  myGLCD.drawLine(0, 14, 319, 14);
  myGLCD.print("LatchButtons", CENTER, 1);
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.print("Touch screen to start", CENTER, 119);
  myGLCD.clrScr();
  myGLCD.print("Latches", CENTER, 50);
  myGLCD.print("Buttons", CENTER, 170);
 
  timeStart = micros();
  myTFT.SetTouchTriangleColors(0, ORANGE, PURPLE, FILL);        // ID number, Pressed Color, Released Color, FILL/NOFILL)
  timeCollect[0] = micros() - timeStart;
  timeStart = micros();
  myTFT.SetLatchTriangleColors(1, WHITE, CYAN, FILL);          // ID number, Latched Color, UnLatched Color, FILL/NOFILL)
  timeCollect[1] = micros() - timeStart;
  getButton();
  myGLCD.clrScr();
  for(byte idx = 0; idx < 5; idx++)
  {
   myGLCD.print(functs[idx], 0, idx * 20);
   myGLCD.printNumF(float(timeCollect[idx]) / 1000.00,3, 200, idx * 20 );
  } 
}

void getButton()
{
  timeStart = micros();
  myTFT.TouchTriangle_Draw(55,180,50,up, 0, 0); // (x,y,radius, ID number)
  timeCollect[2] = micros() - timeStart;
  timeStart = micros();
  myTFT.LatchTriangle_Draw(265,55,50,up, 0, 1); // (x,y,radius, ID number)
  timeCollect[3] = micros() - timeStart;
  timeCollect[4] = micros() - timeCollect[0];
}

Output:
Quote
Set TT color: 0.007
Set LT color: 0.011
TT_Draw: 419.235
LT_Draw: 417.835
Total Time: 838.088?
906  Development / Other Software Development / Re: New TFT Extension Library on: March 30, 2014, 03:00:50 pm
Radio button time track, 1 group of both types with 4 buttons each

Code:
#include <ITDB02_Graph16.h>
#include <ITDB02_Touch.h>
#include <TFT_Extension_old.h>
#include <math.h>
// Declare which fonts we will be using
extern uint8_t SmallFont[];

//
//myGLCD(RS,WR,CS,RST,ALE,mode);
ITDB02 myGLCD(A1,A2,A0,A3,A5,ITDB32S);
//myTouch(TCLK,TCS,DIN,DOUT,IRQ);
ITDB02_Touch  myTouch(13,10,11,12,A4);

TFT_Extension_old myTFT(&myGLCD, &myTouch, LANDSCAPE);

int cx, cy;
unsigned long timeStart, Total, timeCollect[9];
char * functs[11] = {
  "Setup TRB: ", "Setup TRCB: ", "Set RB colors: ", "Set RCB colors: ","1x RadioButton: ",
  "4x RadioButtons: ","1x RadioCircleButton: ",
  "4x RadioCircleButton: ", "Total Time: "};

void setup()
{
  myGLCD.InitLCD(LANDSCAPE);
  myGLCD.clrScr();
  myGLCD.setFont(SmallFont);
  myTouch.InitTouch(LANDSCAPE);
  myTouch.setPrecision(PREC_LOW);
  for(int line = 0; line <= 239; line++)
  {
    myGLCD.setColor(0, 0, line);//text color White 
    myGLCD.drawLine(0, line, 319, line);
  }
  Serial1.begin(9600);
  startup();
  getButton();
  myGLCD.clrScr();
  for(byte idx = 0; idx < 8; idx++)
  {
   myGLCD.print(functs[idx], 0, idx * 20);
   myGLCD.printNumF(timeCollect[idx], 200, idx * 20 );
   Total += timeCollect[idx] / 1000.00;
   myGLCD.printNumF(Total,3, 200, 200 );
  }
}

void loop() {}

void startup()
{
  myGLCD.setColor(255, 0, 0);//red box fill
  myGLCD.fillRect(0, 0, 319, 13);//text box
  myGLCD.setColor(255, 255, 255);//text color White
  myGLCD.setBackColor(255, 0, 0);//background of text red
  myGLCD.drawLine(0, 14, 319, 14);
  myGLCD.print("ARDUINO RADIOBUTTONS", CENTER, 1);
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.print("Touch screen to start", CENTER, 119);

  for(int line = 0; line <= 239; line++)
  {
    myGLCD.setColor(0, 0, line);//text color White 
    myGLCD.drawLine(0, line, 319, line);
  }
 
  uint8_t nums[1] = {4}; // 4 buttons per group
 
  timeStart = micros();
  myTFT.TotalRadioButtons(nums,1);
  timeCollect[0] = micros() - timeStart;
  timeStart = micros();
 
  myTFT.TotalRadioCircleButtons(nums,1);
  timeCollect[1] = micros() - timeStart;
  timeStart = micros();
 
  myTFT.SetAll_RB_Outer_Color(BLACK);
  myTFT.SetAll_RB_Toggled_Color(GREEN);
  myTFT.SetAll_RB_Untoggled_Color(YELLOW);
  timeCollect[2] = micros() - timeStart;
  timeStart = micros();
 
  myTFT.SetAll_RCB_Outer_Color(PURPLE);
  myTFT.SetAll_RCB_Toggled_Color(BLUE);
  myTFT.SetAll_RCB_Untoggled_Color(RED);
  timeCollect[3] = micros() - timeStart;
}

void getButton()
{
  timeStart = micros();
  myTFT.RadioButton(10,10,50,50,0,0);
  timeCollect[4] = micros() - timeStart;
  myTFT.RadioButton(10,60,50,100,1,0 );
  myTFT.RadioButton(10,110,50,150,2,0 );
  myTFT.RadioButton(10,160,50,200,3,0 );
  timeCollect[5] = micros() - timeStart;
//=================================================
  timeStart = micros();
  myTFT.RadioCircleButton(80,30,20,0,0 );
  timeCollect[6] = micros() - timeStart;
  myTFT.RadioCircleButton(80,80,20,1,0 );
  myTFT.RadioCircleButton(80,130,20,2,0 );
  myTFT.RadioCircleButton(80,180,20,3,0 );
  timeCollect[7] = micros() - timeStart;
}

Output: Time in milliseconds
Quote
Setup TRB: 0.003
Setup TRCB: 0.007
Set RB colors: 0.027
Set RCB colors: 0.031
1x RadioButton: 66.895
4x RadioButton: 267.587
1x RadioCircleButton: 451.563
4x RadioCircleButton: 1806.251
Total Time: 2589.999
907  Development / Other Software Development / Re: New TFT Extension Library on: March 30, 2014, 10:07:05 am
@robtillaart Not at the moment no. Actually what would be the best way to do that?

@Jeroi Thanks, I know the filing structure is bad, I didn't think anyone would mind it, but I will change it.
908  Development / Other Software Development / Re: New TFT Extension Library on: March 29, 2014, 09:58:00 pm
OK I got a nice little update on the library, I added quite a few new functions which may look confusing to use, but I provided example sketches on how to use them. I also a library description (.docx), hopefully it will clear up any questions.

New Functions:
TouchButton_Draw   
LatchButton_Draw   
TouchCircle_Draw   
LatchCircle_Draw   
TouchTriangle_Draw
LatchTriangle
LatchTriangle_Draw

SetTouchButtonColors   
SetTouchCircleColors   
SetLatchButtonColors   
SetLatchCircleColors   
SetTouchTriangleColors   
SetLatchTriangleColors

   
The Connect Four game is nearly complete, I just need to fix the computers diagonal blocking algorithm and make it bluetooth capable. 

I am still adding things to the library but at the length it is right now (+50 functions), there is still work to be done before I consider it complete.

There are a couple of sketches I provided that are still set to the old libraries but its not difficult to change them to the newer ones.

Try it out.
909  Using Arduino / Programming Questions / Re: SoftwareSerial.h RX and TX pins on: March 29, 2014, 03:47:46 am
You shouldn't desolder anything.

From what I read when I looked up that library, the older GSM model used D4 and D5, (pin 4 & 5) for the software serial pins but the newer model was changed to use pins 2 & 3, so it is possible nothing is connected to D4 & D5.  But it is never a good idea to change a shield pin unless you are absolutely sure it is not being used, and i'm not absolutely sure. So the better way to solve this problem is to move whatever you have on pin 2 right now to another pin.

Really all you need to do is set the pinMode for pins 4 or 5 as either INPUT or OUTPUT and see if that causes the GSM module to act strange. If it does, then you know you can't use those pins.
910  Using Arduino / Programming Questions / Re: SoftwareSerial.h RX and TX pins on: March 29, 2014, 01:56:29 am
Quote
Unfortunately I've already used pin 2 for some other purpose.
So change that "other purpose" to another pin and leave pin 2 for the GSM.

You can't change the pin on the GSM shield because it is already hardwired to use pin 2. However, you could reroute the GSM pin to another pin with a wire. Please note this will mean you would need to either unsolder the pin from the GSM shield, which I DO NOT recommend, because it could damage the shield; or bend the pin outward and use a male to female jumper wire to move it to another pin. Only then can you change the GSM_TXPIN in the .cpp file.
911  Using Arduino / Programming Questions / Re: Oven Timer Functionality - Counting by 1's and 10s on: March 28, 2014, 05:53:51 pm
You are in luck, because a long while ago another person had a similar problem, and I helped him with the code.

Code:
const byte buttonPin1 = 2; // Up button
const byte buttonPin2 = 3; // Down Button

boolean buttonState1 = 0;
boolean lastReading1 = 0;
boolean buttonState2 = 0;
boolean lastReading2 = 0;
unsigned long onTime1 = 0, onTime2 = 0;
unsigned long interval = 1000;
unsigned long holdAmount = 5;
int count = 0, lastCount;

void setup() {
  //pinMode(ledPin, OUTPUT);     
  pinMode(buttonPin1, INPUT);
  pinMode(buttonPin2, INPUT);

  Serial.begin(115200); 
}

void loop()
{
  buttonState1 = digitalRead(buttonPin1);
  buttonState2 = digitalRead(buttonPin2);

  if (buttonState1 == HIGH && lastReading1 == LOW)
  {
    onTime1 = millis();
    count < 60 ? count++ : count = 0;
  }
  if (buttonState2 == HIGH && lastReading2 == LOW)
  {
    onTime2 = millis();
    count > 0 ? count-- : count = 59;
  }

  //held
  if (buttonState1 == HIGH && lastReading1 == HIGH)
  {
    if ((millis() - onTime1) > interval )   
    {
      onTime1 = millis();
      count < 60? count += holdAmount : count = 0;
      lastReading1 = LOW;
    }
  }
  if (buttonState2 == HIGH && lastReading2 == HIGH)
  {
    if ((millis() - onTime2) > interval )
    {
      onTime2 = millis();
      count > 0 ? count -= holdAmount : count = 59;
      lastReading2 = LOW;
    }
  }
  if(count != lastCount)
  {
   Serial.println(count);
   lastCount = count;
  }
  lastReading1 = buttonState1;
  lastReading2 = buttonState2;
}
912  Using Arduino / Programming Questions / Re: Using TFT button for dual purposes on: March 27, 2014, 10:04:39 pm
I updated the functions in my library, now im just writing up the comments and a description on the functions. I added a few new functions but everything is commented.
913  Using Arduino / Programming Questions / Re: Using TFT button for dual purposes on: March 27, 2014, 09:43:06 pm
Quote
boolean me = myTFT.LatchCircle(55,180,50,0,tx,ty); // (x,y,radius, tx,ty)
if 55 is x, 180 is y, 50 is radius, tx is tx, ty is ty then what is ,0,?
The 0 is an ID number, so say you want four latch buttons, then you would have it like this.
Code:
myTFT.LatchCircle(20,180,20,0,tx,ty);
myTFT.LatchCircle(40,180,20,1,tx,ty);
myTFT.LatchCircle(60,180,20,2,tx,ty);
myTFT.LatchCircle(80,180,20,3,tx,ty);

The reason I had it as boolean me = myTFT.LatchCircle(55,180,50,0,tx,ty); is so I could show that it is latching when touched. You don't really need to see that it is latched, you just need to know that it will be 1 when touched and 0 when touched again. Originally boolean me was byte me, it was an inside joke

You can also use the button functions in IF/ELSE statements like
Code:
if( myTFT.LatchCircle(55,180,50,0,tx,ty) )
  // touch once, it will be true
else
 // touch  again, it will be false

I think I told you before that you don't need to have the tx and ty, unless you want to use the raw touch data, so you would have it like this.
Code:
if( myTFT.LatchCircle(55,180,50,0) )
  // touch once, it will be true
else
 // touch  again, it will be false

Added: I remember seeing that sketch before, you were having the issues with your pump values. You would click on one and it wouldn't change the value until you changed the screen and went back in, did you ever fix that?
914  Using Arduino / Programming Questions / Re: Using TFT button for dual purposes on: March 27, 2014, 02:44:07 am
Im updating the library right now so I'll put in comments.
I'll send you a link to the updated library, hopefully I'll get done with by tomorrow night, if not then the next day.

With the touch buttons and latch buttons, it takes two pairs of coordinates, the top left and bottom right. The circles are just one pair of XY coords and a radius. Also the XY coords you enter become the center of the circle.

The Latching buttons are the same except they need an identifying number on the end.
915  Using Arduino / Programming Questions / Re: Using TFT button for dual purposes on: March 27, 2014, 02:20:31 am
I tried this on my screen and they appear on the top left corner of the screen. The green circle covers the small red circle, and he green circle does go off the screen a little bit, but I can still see it. Try moving them down the screen more.
Pages: 1 ... 59 60 [61] 62 63 ... 251