Show Posts
Pages: 1 ... 42 43 [44] 45 46 ... 252
646  Development / Other Software Development / Re: New TFT Extension Library on: June 07, 2014, 02:59:12 pm
UPDATE!

Library is below.
647  Using Arduino / Programming Questions / Re: Help me in pressure sensor read from 0 - 10Vdc 0-250 bar on: June 07, 2014, 12:01:36 pm
The pressure sensor needs 10v? What does it output then, I'm assuming more than 5v. If 125 Kpa is the max then with a little math 125/5 = 25, so why are you multiplying "volt" by 31.3, and not 25?
648  Using Arduino / Programming Questions / Re: Help me in pressure sensor read from 0 - 10Vdc 0-250 bar on: June 07, 2014, 11:29:02 am
Did you make the voltage divider circuit and does it work now?
649  Using Arduino / Project Guidance / Re: Mecanum Wheels on: June 06, 2014, 01:24:49 pm
This is the camera I am using Mini Wireless Security Camera with this mount Arduino Servo Mount
650  Using Arduino / Project Guidance / Re: Mecanum Wheels on: June 06, 2014, 12:57:10 pm
Wireless video stream.

The code snippet I gave is basically your Mode 1.
Mode 2 is a bit different, to strafe left and right, the wheels need to rotate opposite of each other.

Like so, F = forward, R = reverse
Left:   Right:
F        R   : (front wheels)
R        F   : (rear wheels)
651  Using Arduino / Displays / Re: Help Arduino Mega 2560 + 3.2" TFT LCD on: June 06, 2014, 11:39:35 am
Your using the UTFT and UTouch libraries, you should be able to run the calibration sketch. Attached is the calibration sketch, You may need to change a few lines to get it to work, like you pin numbers and model.
652  Using Arduino / Project Guidance / Re: Mecanum Wheels on: June 06, 2014, 10:39:39 am
This is my truck. http://youtu.be/aOkvHuVhnMA which original started from this (code wise) http://youtu.be/86x_E6Ngpmc
653  Using Arduino / Project Guidance / Re: Mecanum Wheels on: June 06, 2014, 09:59:10 am
Quote
I am only using 2 axis joystick. for example parallax 2 axis joystick hardwired to arduino mega on two analog inputs.
You want to hardwire the joystick to the same arduino, or make it wireless?

Either way you would need to convert the 0-1023 range from the joysticks to values for your motors. I used the map() function and a few IF/ELSE statements for my RC truck.

Here is my drive code(not the full code). My controller outputs 0 - 20 for both Forward/Reverse and Left/Right, then from those values, drive the motors accordingly.
Code:
void move(int z, int y, int s)

  //Movement varibles
  int DRV2 = map(z, 0, 10, 255, 0); //Reverse
  int DRV1 = map(z, 10, 20, 0, 255); // Forward
  int STRL = map(y, 0, 10, 255, 0); // Left
  int STRR = map(y, 10, 20, 0, 255);// Right

  if(z > 10)//forwards, Center point is 10, so if z is greater than 10, go forward, else reverse.           
  {
    //Serial.println("Forward with turning");
    analogWrite(LMF, constrain(abs(DRV1 - STRL),0,255));
    analogWrite(RMF, constrain(abs(DRV1 - STRR),0,255));   
    digitalWrite(LMR, LOW);
    digitalWrite(RMR, LOW);   
  }
  else if(z < 10)//backwards               
  {
    //Serial.println("Reverse with turning");
    digitalWrite(LMF, LOW);
    digitalWrite(RMF, LOW);   
    analogWrite(LMR, constrain(abs(DRV2 - STRL),0,255));
    analogWrite(RMR, constrain(abs(DRV2 - STRR),0,255));   
  }
  else if(z == 10 && y > 10)//Right               
  {
    //Serial.println("360 left");
    digitalWrite(LMR, LOW);
    analogWrite(RMR, STRR);   
    analogWrite(LMF, STRR);
    digitalWrite(RMF, LOW);
  }
  else if(z == 10 && y < 10)//Left             
  {
    //Serial.println("360 right");
    analogWrite(LMR, STRL);
    digitalWrite(RMR, LOW);   
    digitalWrite(LMF, LOW);
    analogWrite(RMF, STRL);   
  }

  else //full stop
  {
    digitalWrite(LMF, LOW);
    digitalWrite(RMF, LOW);       
    digitalWrite(LMR, LOW);
    digitalWrite(RMR, LOW);   
  }
  y=0; z=0; s=0;
}

Have you tested your motors with some simple code? Forward, reverse, left, right ?
654  Using Arduino / Project Guidance / Re: Mecanum Wheels on: June 06, 2014, 09:30:39 am
Good, now how do you plan on controlling it, what have you decided on? Both Xbox and Ps3 controllers will need the USB host shield and Bluetooth dongles to work. Or you can go with either paired bluetooth modules or RF modules. The "modules" are easier to learn and use, but are not compatible with a xbox or Ps3 controllers. The downside of these module is you would need a second arduino to act as a controller.

Quote
Two kangaroo motor controllers
Kangaroo makes motor controllers? Never mind

Alternative:
If you want, you can use a wireless Ps2 controller, which would give you the same range as a Ps3 or Xbox, and you won't need to buy a USB host shield or a second arduino. Also they are VERY cheap now, gamestop probably has them for $5 on the clearance rack.
655  Using Arduino / Project Guidance / Re: Mecanum Wheels on: June 06, 2014, 09:18:47 am
It actually easier than you think, especially with the numerous topics on skid steering and single joysticks. However, because you want to strafe left and right, this would mean you need two motor driver controllers. one for the front wheels and the other for the back wheels.

What parts do you have already?
656  Development / Other Software Development / Re: New TFT Extension Library on: June 05, 2014, 04:01:09 pm
Notice:
I have a few new functions coming out soon. One is already done and its called TouchCircleByQuad
Basically it will return the quadrant of which you touched, (1,2,3 and 4) or you can specify a specific quadrant(s) and it will return true if it/they are touched.

The other two are Swipe and SwipeFromArea.
Swipe: Will return a value based on the direction you swiped on the screen from your initial touch(anywhere on screen). 1 = up, 2 = down, 3 = left and 4 = right. I am still fine tuning this function but it's not 100% yet.

SwipeFromArea: Needs an area to swipe from and a direction(x1, y1, x2, y2). This function will allow you to do things like, do something when only the bottom left side of the screen is swiped to the right or you can add multiple functions to do different things. Not 100% yet either.

I am also thinking of adding double tap buttons, but I don't know if they are really needed. But if someone wants them, I will add them.
657  Using Arduino / Displays / Re: Help Arduino Mega 2560 + 3.2" TFT LCD on: June 05, 2014, 01:56:37 pm
If you run the calibration sketch, it will give you values at the end, to replace the CAL_X/Y and S, thus fixing your problem.
658  Using Arduino / Displays / Re: Help Arduino Mega 2560 + 3.2" TFT LCD on: June 05, 2014, 01:38:07 pm
You shouldn't have to divide anything by 5.5, if the screen / touch ratio is correct, the code will already do it for you.
659  Using Arduino / Programming Questions / Re: Format a float as xx.xx ? on: June 05, 2014, 12:44:43 pm
If this is just for the serial monitor or a display, then yes,  there is a way to do this. Leading zeros drop off, so instead of 01.35, you only see 1.35. But you can send out the char '0' before the number, so on screen it would appear as 01.35. All you would need to do is monitor the number and if it is less than 10, print the char '0' then followed by the number.

Added: I cant remember if printf will do it or not, I will check. It should be something like %02.2f.

Found it, but its not quite what you want.
Quote
/* printf example */
#include <stdio.h>

int main()
{
   printf ("Characters: %c %c \n", 'a', 65);
   printf ("Decimals: %d %ld\n", 1977, 650000L);
   printf ("Preceding with blanks: %10d \n", 1977);
   printf ("Preceding with zeros: %010d \n", 1977);
   printf ("Some different radices: %d %x %o %#x %#o \n", 100, 100, 100, 100, 100);
   printf ("floats: %4.2f %+.0e %E \n", 3.1416, 3.1416, 3.1416);
   printf ("Width trick: %*d \n", 5, 10);
   printf ("%s \n", "A string");
   return 0;
}


Output:

Characters: a A
Decimals: 1977 650000
Preceding with blanks:       1977
Preceding with zeros: 0000001977
Some different radices: 100 64 144 0x64 0144
floats: 3.14 +3e+000 3.141600E+000
Width trick:    10
A string
660  Using Arduino / Displays / Re: Help Arduino Mega 2560 + 3.2" TFT LCD on: June 05, 2014, 12:26:33 pm
Where did you download your library from, can you provide a link. The values that are shown on  screen fit where you touched the screen, but the display is off. I think the screen is set to 240x400, but the touchpad is set to 240x320. This would explain why when you touch the edge of the screen, you see 319, but the dot only goes 4/5 the way.

You need to calibrate your display / touch ratio and fix the CAL_X and CAL_Y values in the UTouchCD.h file.
Pages: 1 ... 42 43 [44] 45 46 ... 252