Show Posts
Pages: 1 ... 48 49 [50] 51 52 ... 253
736  Using Arduino / Project Guidance / Re: accelerometer programming on: May 19, 2014, 11:40:44 am
Easy enough, a simple IF/ELSE statement can do what you want. What kind/type of accelerometer are you using, a link would be helpful.
737  Development / Other Software Development / Re: New TFT Extension Library on: May 19, 2014, 06:55:50 am
Ok, I can make a quick function to allow you to repaint the gauge.

Added:
Function: ResetGauge( byte _ID ), This should go in the next and previous pages of the gauge. So if your gauges are on page 2, then this function needs to be in pages 1 and 3. So when you go back to page 2, the gauge will be repainted.

Library added below.
738  Using Arduino / Programming Questions / Re: code compiling, but will not actually work on: May 18, 2014, 03:42:28 pm
Well then that means you need to start going through them and debug them one at a time.
Get one part to work then add another and keep doing this until it stops working, once it stops working then you will know which one it giving you the problems.
739  Using Arduino / Programming Questions / Re: code compiling, but will not actually work on: May 18, 2014, 03:03:50 pm
Do you know if your Serial monitor (the terminal itself) is set to 9600 baud?
740  Using Arduino / Programming Questions / Re: Help understanding why this concept doesn't work on: May 17, 2014, 10:44:19 pm
Get rid of XYZ and ROW1 and make ROW2 a two dimensional array with the stuff from XYZ.

ROW2[3][3] = {
{0,1,2},
{4,5,6},
{7,8,9}
};
741  Using Arduino / Project Guidance / Re: How to make arduino recognize a pair of numbers and turn on an led. on: May 17, 2014, 10:03:15 pm
It doesn't get much more simpler than this.
Code:
int buffer[8];
int counter = 0;

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

void loop()
{
  if(Serial.available() > 0)
  {
    char temp = Serial.read(); // example incomming data <1,23,456,7890>
    if( temp == '<' ) // is incoming char equal to <, if so gather the rest
    {
      counter = 0; // make sure counter is set to zero
      while(1)
      {
        if(Serial.available() > 0)
        {
          char temp = Serial.read(); // read in incoming char
         
          if(temp != ',' && temp != '>')
          {
            buffer[counter] = (buffer[counter]*10) + (temp - '0');// converts temp into an int then stores it
          }

          if(temp == ',')
          {
            counter++; // increment buffer index
          }

          if(temp == '>') // if incoming char is >, then break out of loop
          { 
            break; // breaks out of the while loop
          }
        }
      }
    }
    for(int NUM = 0; NUM <= counter; NUM++) //will output "1,23,456,7890"
     {
       Serial.print(buffer[NUM]);
       if(NUM != counter) Serial.print(",");
     }
     Serial.println();
  }

  while(counter != -1) // clear the buffer
  {
    buffer[counter] = 0;
    --counter;
  }
}
742  Using Arduino / Project Guidance / Re: How to make arduino recognize a pair of numbers and turn on an led. on: May 17, 2014, 09:11:54 pm
Ok, that's easy enough and there are a few ways to do it, but the most common way it to use a container "Packet". You want to send the data as < value1 , value2 >. If the first char is '<', then collect the rest until the serial monitor receives '>'. A comma is a good way to split the data into multiple parts, so you will need that too.

So it would be something like this.
Quote
if(Serial.available() > 0){
    char temp = Serial.read(); // example incomming data <1,23,456,7890>
    if( temp == '<' ) // find this char in the buffer, and start collecting the rest after it.
    {
    while( true ) // just a loop to continuously gather the rest of the chars
     // another Serial.available and Serial.read() here.

     //look at the incoming char and see if it is a comma or the end of the container '>'
     // if it in not a comma or >, then store the char(s) into a temporary array
     // if the char IS a comma then increment the arrays index by 1 to store the next char(s)

     // keep doing this until the incoming char is > then break out of the while loop and you should have all your data

I have a working example if you want to take a look at it.
743  Development / Other Software Development / Re: New TFT Extension Library on: May 17, 2014, 07:08:22 pm
Library is updated with new functions, HorBarGraph and VertBarGraph. Go back to previous post and re-download.
Look at Horizontal_BarGraph example to see how it is used.

I also added your username to the .h file.
744  Development / Other Software Development / Re: New TFT Extension Library on: May 17, 2014, 06:28:11 pm
Oh ok, so the other way around, instead of being a slider, you want a bar graph. Yea I can do that.
745  Development / Other Software Development / Re: New TFT Extension Library on: May 17, 2014, 05:56:03 pm
Quote
edit: also the HorSlider and VertSlider functions can they be used as a display?  for instance analogRead(A0) map the values from 0-100 then use those as a display?
? What kind of display? They return 0-100 as a percent, so what else do you have in mind?

Updated library with new Gauges (10 Max)

Also all _Draw functions, (TouchButton_Draw, LatchCircle_Draw, TouchTriangle_Draw. . . etc) are now able to have centered text, they don't limit the text to the size of the "button", sorry too much code for that.
See the Latching_Buttons example.

Question for everyone else.
The library is kinda getting out of hand with all the structs, so if anyone has a better alternative, please share it. At first I was thinking of making everything into individual classes, but then everyone would need to drastically modify there sketches to use them. So if anyone has any ideas, please share and I will see what I can do.
746  Development / Other Software Development / Re: New TFT Extension Library on: May 17, 2014, 04:27:06 pm
I could make it so you could have more than one guage, let me modify the library.
747  Using Arduino / Project Guidance / Re: Making a rookie relay module mistake? on: May 16, 2014, 06:26:59 pm
Just so Im making sure I am clear joined should be the arduino ground, the 12v ground, the ground from the relay module, and the one from the motor as well?
correct.
748  Using Arduino / Project Guidance / Re: Making a rookie relay module mistake? on: May 16, 2014, 06:23:31 pm
Do you have the 12V gnd connected to the arduino gnd, because they should be, for it to work.
749  Using Arduino / Project Guidance / Re: Making a rookie relay module mistake? on: May 16, 2014, 05:54:14 pm
Quote
The relay coils run on 12VDC, and the module has screw-terminal blocks for sturdy and reusable attachments for the external load. The signal and power inputs run through the male single-row header.

The relay board needs 12V to work properly not the 5V @ 200mA the Arduino supplies.
750  Development / Other Software Development / Re: New TFT Extension Library on: May 12, 2014, 12:56:29 pm
New game: Missile Bomber

Objective: destroy the incoming missiles and do NOT let them fall to the ground. Each missile is enough to wipe out an entire city, and if all 20 cities are destroyed, game over.

To destroy a missile, touch the center of them. 5 points for blowing up a missile, and 50 points triggers an additional missile. (6 max)

(Please keep in mind that an Arduino is not meant to display fast moving objects, so it will slow down.)

If anyone has a Due, let me know if it is any better. A small video would be helpful.
Pages: 1 ... 48 49 [50] 51 52 ... 253