Show Posts
Pages: 1 ... 30 31 [32] 33 34 ... 196
466  Using Arduino / Programming Questions / Re: Midi Input, Led. almost working but not very well :( on: January 26, 2014, 06:02:31 am
Your code is a train wreck, please fix the format so it looks presentable and possibly readable.
467  Using Arduino / Programming Questions / Re: Reading characters from LCD on: January 26, 2014, 06:00:26 am
Are you referring to a memory dump? LCD screens don't store any data, they just display what you tell them. If you want to keep a record if what was displayed, you will need to make an array for each row and update it every time you add something new.
468  Using Arduino / Programming Questions / Re: Adding buttons to my Simon Says game & general questions. on: January 26, 2014, 05:57:16 am
It might work, but your really better off debouncing them. This way if you game doesn't work, you'll know it's not the buttons causing it, but another issue. Why leave gaps if you don't want to fall in later?
469  Using Arduino / Programming Questions / Re: Touch screen calibration problem. on: January 25, 2014, 07:02:40 pm
@PaulS, with those type of LCD displays, you can't use the serial monitor. This is because the pins 1 and 0 are used as the data buses. So his only means of debugging is the screen itself. And he does in fact have a debug screen.

Quote
if (Touch.dataAvailable())
    {
       Touch.read();
       x=Touch.getX();
       y=Touch.getY();
    }
   else
    {    
       x=0;
       y=0;  
    }
    
    LCD.setFont(BigFont);
    LCD.setColor(VGA_WHITE);
    LCD.print("X=",0,60);
    LCD.print("Y=",0,80);
    LCD.print("      ",40,60);
    LCD.printNumF(x,0,40,60); //Pomen (St. decimalnih mest,Postavitev po dolžini ekrana,Postavitev po višini ekrana)
    LCD.print("      ",40,80);
    LCD.printNumF(y,0,40,80);

    LCD.setColor(VGA_RED);
    LCD.fillRoundRect(100,150,200,200); //Pomen (Začetek po dolžini, začetek po višini, velikost po dolžini, velikost po višini)
  
   if ((y>=150) && (y<=200))
    {  
      if((x>=100) && (x<=200))
      {
       pritisnjen (0,0,50,50);
      }
 
    }
   else
    {
     nepritisnjen (0,0,50,50);
    }
470  Using Arduino / Project Guidance / Re: My 1st project: TIE Crawler from the Star Wars Expanded Universe on: January 25, 2014, 06:52:40 am
Tanks use differential steering, which takes the difference of two motors. It probably can be done with a single motor but you will need a transmission to divide the power to the treads.

Added:
If you can find pancake motors, then you can mount the motors to the back plate and use gears to drive the treads.
471  Using Arduino / Programming Questions / Re: Removing chars per index in a char array on: January 25, 2014, 06:36:43 am
Well one way would be to shift the elements.

for(byte d = 0; d < 20; d++)
{
   Array[d] = Array[d+1];
}

This will shift out the first element, and you use an IF statement, to add a NULL or 0 in the last element.

Or.

The other way would be to simply copy the elements of the Array to a new one, starting at the second element and stop before it gets to the last element.
472  Using Arduino / Project Guidance / Re: My 1st project: TIE Crawler from the Star Wars Expanded Universe on: January 25, 2014, 06:21:37 am
If I was making that, I would use worm gears and have the motors consealed inside the treads along with the batteries for weight. Possibly the motor controllers too.
473  Using Arduino / Programming Questions / Re: Adding buttons to my Simon Says game & general questions. on: January 24, 2014, 05:03:18 pm
The buttons in your picture are called tactile buttons. When pressed, they don't produce a perfect signal, they bounce first then give a stable signal. That bounce is no good to have because your code will do its action when the state of the button changes. So in order to take out that bounce, you need to read the button, let some time pass (milliseconds, 50 is often used) then read the button again and that second reading is the one that's used. This seems complicated but don't worry, you have an example sketch you can learn from under File -> Examples -> digital -> Debounce.
474  Using Arduino / Project Guidance / Re: My 1st project: TIE Crawler from the Star Wars Expanded Universe on: January 24, 2014, 04:52:45 pm
At this time, I can't say. I don't know how much space you will have or how your treads will be connected to the motors. I need more info.
475  Using Arduino / Project Guidance / Re: Arduino GPS Speedo project on: January 24, 2014, 11:22:34 am
Your LCD should come with a library and some example sketches. They should also tell you how you need to wire it to the Arduino, it might be fast, it might not. That you need to research too.
476  Using Arduino / Project Guidance / Re: Arduino GPS Speedo project on: January 24, 2014, 11:14:12 am
Quote
...with a TFT LCD module Display similar to this:
So what LCD are you actually using?
477  Using Arduino / Project Guidance / Re: Arduino GPS Speedo project on: January 24, 2014, 11:04:30 am
Quote
My first question is what Arduino do you think would be most suitable?
Any Arduino is suitable, it all depends on how much space you have to work with and the amount power your able to supply.

That LCD look like it needs an LCD shield, that is if you want it to be stacked on an Arduino like a UNO or MEGA. However if you run your own wires, then you can use smaller Arduinos like the Nano, Mini or Micro. What are you planing on using as a power supply? A regular 9V battery will not last more than half and hour before its dead, so your better off using rechargeable battery packs.
478  Using Arduino / Programming Questions / Re: Adding buttons to my Simon Says game & general questions. on: January 24, 2014, 10:54:43 am
Quote
I am well aware that I have to replace the delay in my loop with the button-sequence, but how I have no idea.

You will first need to debounce the buttons, then you need to cycle through them and compare them to the lit LED. A simple FOR should work. Your buttons are 5 pins lower to your LEDs, so you can start on pin 4 (button) and see if the corresponding LED (+5) is lit. If the LED is lit add the next pattern, if it's not then player has lost.

Quote
Also, it's a problem that everytime I reset my Arduino, it generates the same sequence of LED's, making it "non-random", since every game is the same then.

The random function as you found out, is not random. So what you can try is use a seed that takes the quotient of analog inputs A0 and A1, because one analog pin alone is still not enough.
479  Using Arduino / Project Guidance / Re: Mental block with programming sequence on: January 24, 2014, 10:16:25 am
Here is an example that you can try.

Code:
struct {
  char *password[10];
  char *user[10];
} check;

int cnt = -1, i = 0;

void setup()
{
  Serial.begin(9600);

  Add("1234", "Andy");
  Add("5678", "Joe");
  Add("abcd", "mike");

 while(i != cnt + 1)
 {
  if(!strcmp( "5678", check.password[i]) )  // this compares all the added passwords to one specific one.
  {   
    Serial.println("is good");
    Serial.print("Welcome back, ");
    Serial.print(check.user[i]);
    Serial.println();
    break;
  }
  else i++;
 }
 if(i == cnt + 1) Serial.println("Not Good");
}

void loop()
{
 
}

void Add(char * input,  char * username) {
  cnt++;
  check.password[cnt] = input;
  check.user[cnt] = username;
}
 
480  Using Arduino / Project Guidance / Re: My 1st project: TIE Crawler from the Star Wars Expanded Universe on: January 23, 2014, 01:25:29 pm
Depending on what parts you use, it could range between 4 - 9 lbs
Pages: 1 ... 30 31 [32] 33 34 ... 196