Show Posts
Pages: 1 2 3 [4] 5 6 ... 228
46  Using Arduino / Audio / Re: Arduino library for WTV020-SD-16P audio module on: July 12, 2014, 11:29:39 pm
Take a look at the attachment below. On page 5, it gives you a layout of what each pin does, and if you look at pin P04 and P05, you will see a secondary function. P04 is the clock, and P05 is the data, so with that, you basically only need two pins to get it to work, but you also need to send the correct data too.

The library was made to send said data, and all you need to do is wire it correctly.
47  Using Arduino / Audio / Re: Arduino library for WTV020-SD-16P audio module on: July 12, 2014, 05:38:33 pm
Basically anything that uses a button can be replaced by the arduino. Volume, next/prev song, pause/play.
48  Using Arduino / Project Guidance / Re: Password checker on: July 11, 2014, 10:31:41 pm
Post your code in full.

Quote
I want to empty the array by doing this.
No, your creating an entirely new array but its only accessible from within that function. The global array is not the same as the local array.
49  Using Arduino / Programming Questions / Re: Need help with code for autonomous rc car on: July 11, 2014, 10:26:39 pm
if(2 <= distance && distance <= 20) // car is too close to a wall or object
{
    //Stop / reverse / turn / self destruct / turn the other way
}
else // distance is greater than 20, robots path is clear
{
    // drive forward
}

The best thing you can do is make a state machine. Write out exactly what you want to robot to do in a certain situation and then convert that into code.
50  Using Arduino / Programming Questions / Re: Need help with code for autonomous rc car on: July 11, 2014, 06:49:36 pm
Yea, you can do that.
51  Using Arduino / Project Guidance / Re: Password checker on: July 11, 2014, 05:04:53 pm
Quote
if (passwordCheckInitiated = true) {
Are you supposed to be setting passwordCheckInitiated to true, or comparing it?

Look into arrays for these:
Quote
if (buttonState1 == HIGH && previous1 == LOW && millis() - time > debounce) {
        attemptPW = 1;
        i++;
        time = millis();
      }
      previous1 = buttonState1;

Shouldn't this be global? int attemptPW[4] = {};

What and where is the inputted password being compared to?
52  Development / Other Software Development / Re: performance of map() function - an analysis on: July 11, 2014, 02:17:52 pm
Ok, but what about if its cycled 800000 times? Its got to add up to something.
53  Using Arduino / Programming Questions / Re: using held down keys with keypad.h on: July 11, 2014, 02:00:33 pm
Perhaps I missed something, but I don't see how making a copy of key into holdkey does anything different in the case statements.
54  Development / Other Software Development / Re: performance of map() function - an analysis on: July 11, 2014, 01:56:37 pm
How much of a time difference is it, if you make x in uint16_t x = map(i%4095, 0, 4095, 500, 1000); long or 32bit?
The original map function is type long and yours is type int, but your putting the original map value into a int, so it must be converted.

I wonder how much time it takes to convert from long to int?
55  Using Arduino / Programming Questions / Re: Question about splicing an array on: July 11, 2014, 01:44:44 pm
I agree,

1) There is no negative value and it does not go over 255, so you can just use type byte.
2) put them into PROGMEM and structure it like a font file. Attached is a sample font file. It is made for a TFT display, so each char needs to be big enough to see on screen, 8x12 pixels. Yours will be roughly the same.
56  Using Arduino / Programming Questions / Re: Question about splicing an array on: July 11, 2014, 12:46:06 pm
You still haven't said what your using to show the strings.

Quote
but I want the displayChar() to get "ra" as the input, so I can use it in the following code.
What is wrong with what I gave you, it will do exactly what you want, but you just need to fill in the rest to work with your mystery display.

Hell, you can even send in just "rH" and it will display a H
57  Using Arduino / Programming Questions / Re: using held down keys with keypad.h on: July 11, 2014, 09:28:57 am
You seem to be missing somethings very important here. kp.getState == HOLD
Edit: both of you.

How did it compile?
58  Using Arduino / Programming Questions / Re: Need help with code for autonomous rc car on: July 11, 2014, 09:19:08 am
if(2 <= distance && distance <= 20) // stop
59  Using Arduino / Programming Questions / Re: Question about splicing an array on: July 11, 2014, 09:15:18 am
Better function, looks for a proper string.
Code:
void DisplayString(char * STR)
{
  if(strlen(STR)%2 != 0)
    Serial.println("You are missing a color or string letter");
 
  else
  { 
    for(byte i = 1; i < strlen(STR); i+=2)
    {
      switch(STR[i-1])
      {
      case 'r':
        Serial.print("255,0,0");
        break;
      case 'g':
        Serial.print("0,255,0");
        break;
      case 'b':
        Serial.print("0,0,255");
        break;
      }
      Serial.print(" ");
      Serial.println(STR[i]);
    }
  }
}
60  Using Arduino / Programming Questions / Re: Question about splicing an array on: July 11, 2014, 08:59:45 am
Your correct, I haven't had my coffee yet, my mistake.

Code is fixed.

Edit:
I now have my coffee smiley-lol
Pages: 1 2 3 [4] 5 6 ... 228