Show Posts
Pages: 1 ... 18 19 [20] 21 22 ... 244
286  Using Arduino / Programming Questions / Re: Self Balancing sketch runs only when usb is connected on: July 14, 2014, 08:24:16 am
What are you using to power it? Please don't say a regular 9V battery. This battery pack here would be perfect. You could also go to your local hobby shop and find something similar.
287  Using Arduino / Programming Questions / Re: lcd.print(); prints wrong symbols on: July 13, 2014, 03:14:37 am
When exactly does this happen, do you start seeing it after this, Serial.println("No NTP Response :-("); ?
288  Using Arduino / Displays / Re: Help with Unknown TFT LCD on: July 13, 2014, 01:42:33 am
If you need the libraries, just go to Henning Karlsen site directly to download them.

It may take a few tries to get the correct model number, but it shouldn't take you too long as there are not many choice for that size screen. Note, you will need to try both 8 and 16bit models to see which one works.

Here is a pin sample:
//myGLCD(mode,RS,WR,CS,RST,ALE);
myGLCD(ITDB32S,A1,A2,A0,A3,A5);

//myTouch(TCLK,TCS,DIN,DOUT,IRQ);
myTouch(13,10,11,12,A4);
289  Development / Other Software Development / Updated Wii Classic Controller Library on: July 13, 2014, 01:20:24 am
Hello all, as the title says, I have updated the Wii controller library, but since I am not the original creator of the library in the playground, I had to make my own.

If you have used the previous library with the new IDE, then you would have noticed a few things were not quite correct.
For instance, if you press RB (right bumper), it would show :

Please note nothing here was altered or tampered with, this is straight from the output of the example sketch.
Quote
Buttons:LS.RS.RD.DD.select.home.start.
right shoulder: 31
 left shoulder: 0
 left stick x: 14
 left stick y: 14
 right stick x: 26
 right stick y: 30

And if you press the A button, it would show:
Quote
Buttons:lz.y.a.b.
right shoulder: 14
 left shoulder: 1
 left stick x: 14
 left stick y: 14
 right stick x: 26
 right stick y: 30

Pressing ZR will show:
Quote
Buttons:lz.rz.x.y.a.b.
right shoulder: 14
 left shoulder: 1
 left stick x: 14
 left stick y: 14
 right stick x: 26
 right stick y: 30

And same goes for SELECT, START and digital UP and LEFT.

Also notice the stick values, 14 as a midpoint for left stick and 26 for right stickX and 30 for right stickY.
I dont know about you, but these are not the usual values I would expect to see for the midpoint of a potentiometer. I am used to seeing 127 or 128 (byte range, not int) for a midpoint, not 14, 26 or 30.

My library is very similar to the previous library but I got all the bugs out and everything works the way it should.
There is one thing that looks incorrect, and that the stick values. The raw data values go from 0x00 to 0x1F or 0 - 31, what I did was multiply that raw data by 8 to give a better range, BUT the highest value is 248 instead of 256. (31 * 8 = 248)

Let me know what you think.

Edit: Library is now added to the playground

Look at last post for updated Library
290  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.
291  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.
292  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.
293  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.
294  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.
295  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?
296  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.
297  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.
298  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?
299  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.
300  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
Pages: 1 ... 18 19 [20] 21 22 ... 244