Show Posts
Pages: 1 ... 57 58 [59] 60 61 ... 253
871  Using Arduino / Programming Questions / Re: Searching for info regarding the PS2X Library on: April 15, 2014, 07:57:45 pm
I looked over your code and compared it to mine and it seems your missing this function.
ps2x.read_gamepad(false, 0);

Add that function in your loop().
872  Using Arduino / Programming Questions / Re: Searching for info regarding the PS2X Library on: April 15, 2014, 05:27:43 pm
the values come back as expected so I doubt it is a wiring issue...
What values, the buttons?
Can you post a picture of your setup?
873  Using Arduino / Programming Questions / Re: very very important - help me on: April 15, 2014, 05:26:00 pm
You need to have the actual library in the correct place, and some photos of your wiring would be really helpful. Check out this post HERE.
874  Development / Other Software Development / Re: New TFT Extension Library on: April 15, 2014, 04:24:18 pm
I have three more functions on the way, two are already done and one i'm still working on.
The two that are done are drawArc and TouchArc.

drawArc(int cx, int cy, int radius, int start, int stop, int thickness, byte R, byte G, byte B);
Like my circle function, it needs a X/Y coordinate, a radius, and now it needs a start and stop angle, a thickness (will not exceed the radius value or below 0) and finally, a color.

TouchArc(int cx, int cy, int radius, int start, int stop, int thickness);
This function returns a percentage of where you touch the arc from right to left. 0  - 100%

And the last function is a Slider, it can either be horizontal or vertical, and it too will return the percentage of it's level.
It can be mapped to any size or thickness, and I must insist you use a stylist or something with a soft point.
875  Using Arduino / Programming Questions / Re: Searching for info regarding the PS2X Library on: April 15, 2014, 04:13:30 pm
I added the comma and it makes it much easier to read smiley-razz Is there a way I can tell it to kick the next set of values down to the next line on the serial monitor?
Yea, that was my fault, change the last one to Serial.println(Input2);

Is there something wrong with how I used/ setup the map function?
The joysticks work exactly like a potentiometer, so full up is 255 and full down is 0, so in between is 128, and when you map 128, that equals to ~1500. Those values should increase and decrease when you move the stick, if it doesn't then there may be a problem with the wiring or the controller itself.

How much voltage is the controller getting, 3.3 or 5V? I have a regular and a wireless controller and they only seem to work at 3.3V.
876  Using Arduino / Project Guidance / Re: Inconsistent values with Bluetooth and Serial.Read on: April 14, 2014, 11:37:06 pm
Make it Serial.print on the master side and a type char on the slave side.
877  Using Arduino / Programming Questions / Re: Searching for info regarding the PS2X Library on: April 14, 2014, 10:49:00 pm
Is the little center button pressed(red light), the one below the start and select buttons?

Input1 = map(ps2x.Analog(PSS_LY), 0, 255, 1000, 2000);
     Serial.print (Input1);
      Input1 = map(ps2x.Analog(PSS_LX), 0, 255, 1000, 2000);
     // Signal2.writeMicroseconds(Input1);
      Serial.print (Input2);

You should really add a comma to separate them, like so.

Serial.print(Input1); Serial.print(", "); Serial.print(Input2); // I wrote it like this so you can see what I'm trying to do.
Output: yyyy, xxxx
878  Using Arduino / Project Guidance / Re: Wireless Switch Using Transmitters and Receivers on: April 14, 2014, 02:26:57 pm
Yes, with the Virtualwire library, it is possible to do just that.
Do you have the RF modules? If you don't the cheapest modules are these, 433MHz RF transmiter/receiver

Once you do have them, start with turning a LED on and off, then move to the relay.
879  Using Arduino / Programming Questions / Re: Trouble adapting Speed code (Reed Switch) on: April 14, 2014, 01:17:43 pm
Whoever wrote this code, did not label everything. There is a magic number here,
mph = (56.8*float(circumference))/float(timer);
which is crucial to your calculations. You can't just change the radius without knowing what each part does and what each number represents.

What is the 56.8 and how does it work with the original 13.5?
880  Using Arduino / Project Guidance / Re: Arduino for this? Or something else? on: April 14, 2014, 12:02:56 pm
Yes, this is possible to do on an arduino. If you're looking for something small, you might want to look into an Arduino Nano, Micro, and/or Mini. You might also want to get one of these modules HERE

There is an enormous topic on this module in the Audio forum, here is a link

To amplify the audio signal, you can get a cheap guitar amp, and make your own cable to plug into it.
881  Development / Other Software Development / Re: New TFT Extension Library on: April 14, 2014, 11:46:57 am
UPDATE: 4/14/2014

Ok this update has the new polygon and drawStar functions, as well as a new version of the all the Triangle functions.

The polygon and drawStar functions need a single X,Y coordinate, the polygon function, also needs a number of sides(3 - 360) anything more and the function doesn't work. You can also give it a color (still working on how to fill the polygon) and a degree if needed. The drawStar function needs a diameter, a color and a factor (1.0 - 4.0) which is preset to 2.0. This factor controls the thickness of the star. The higher the number, the thinner the star gets, and the factor will not go lower than 1.0 or higher than 4.0

Now with the triangle functions, you don't need to specify a direct like "up, down ,left or right" and also give a degree. The new functions only need the X,Y coords, a base length and a degree. I did leave in the up, down, left and right as degrees, so up = 0 deg, left = 90 deg, down = 180, and right = 270. You can also use these as " up + 45" which is just 45 degrees, or "down - 27" which equals 153 deg.

myTFT.drawStar(160, 120, 30, WHITE);
myTFT.drawStar(160, 120, 30, WHITE, 3.0); // this star is thinner than the one above.

myTFT.Polygon(50, 50, 3, 20, BLUE); // X, Y, sides, diameter

myTFT.drawTriangle(160, 120, 50, up + 45);
myTFT.drawTriangle(160, 120, 50, right);
myTFT.drawTriangle(160, 120, 50, down - 27);

I am still working on being able to fill in the star and polygon shapes, but for now this should do.
882  Using Arduino / Project Guidance / Re: Count 18 lines and pause. on: April 13, 2014, 08:01:01 pm
Can you provide an example of what you're trying to achieve?
883  Using Arduino / Programming Questions / Re: Passing array size on: April 13, 2014, 03:26:41 pm
You need to allocate some memory for the array first. What is the biggest number of samples you want to allow, then make that the initial size.

You can also learn about malloc, calloc, realloc and free.
884  Development / Other Software Development / Re: New TFT Extension Library on: April 11, 2014, 06:10:18 pm
Both types of radio buttons now are able to have text in the center of them. Please note that the text will NOT be cutoff or the buttons size will NOT be altered if the text is larger than the button.

Newest version as of 4/11/2014

I am open to new function ideas if anyone has any. I will of course add your name or username to the functions description.

I am currently working on a star function and I should be done with it soon. As well as a polygon function which will allow the user to enter a number 3 - 10, and it will make the shape with the given sides. Filled in color may be difficult so for now it will just be unfilled.

Added: I finished both of them. They will be in the next update.
885  Using Arduino / Project Guidance / Re: SERVO and Serial Communication on: April 11, 2014, 12:31:05 pm
The condition must be either pos == 0, pos >= 0, pos <= 0, or pos != 0.

No insults needed, but maybe a few face palms are.
Pages: 1 ... 57 58 [59] 60 61 ... 253