Show Posts
Pages: 1 [2] 3 4 ... 20
16  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: February 12, 2014, 12:07:46 pm
Quote
hi, bro estoy tratando de usar tu app de android, es la mejor que e visto, con la parte de los botones no tengo problemas pero no entiendo como usar la el joystick para controlar motores dc con un puente H, si me pudieras dar una orientacion seria exelente, es lo que me falta para terminar el proyecto, te dejo el link del puente h que yo uso.
http://www.pololu.com/product/713


Hi nemesis159

For general matters such as DC motor control, Google is your best friend  smiley-wink
This is a quick basic example for one motor, using joyY (joystick vertical moves)
Pin configuration is based on 328P chip



Code:
*** AndroLED V10.3 modification: ***

/* add this code in the define section */
#define AIN1  4   // connect AIN1 to Arduino pin 4 ...
#define AIN2  5
#define PWMA  6
#define STBY  7
 

/* add this code in the setup function */
pinMode(AIN1,OUTPUT);
pinMode(AIN2,OUTPUT);
pinMode(PWMA,OUTPUT);
pinMode(STBY,OUTPUT);
digitalWrite(STBY, HIGH);


/* replace getJoystickState() with this one */
void getJoystickState(byte data[5])    {
  int joyX = (data[1]<<7) + data[2];
  int joyY = (data[3]<<7) + data[4];
  joyX = joyX - 200;               // Offset to avoid
  joyY = joyY - 200;               // transmitting negative numbers
  
  joyY = map(joyY, -100, +100, -255, 255);
  joyX = map(joyX, -100, +100, -255, 255);
 
  if(!DEBUG)  {
    Serial.print("Joystick data:  ");
    Serial.print(joyX);  
    Serial.print(", ");  
    Serial.println(joyY);
  }

  if(joyY > 0) {
    digitalWrite (AIN1,HIGH);
    digitalWrite (AIN2,LOW);
  }  else if(joyY < 0)  {
    digitalWrite (AIN1,LOW);
    digitalWrite (AIN2,HIGH);
  }  else  {
    digitalWrite (AIN1,LOW);
    digitalWrite (AIN2,LOW);

  analogWrite(PWMA,joyY);
}

Option/Data Range should be set to -100 +100

Please note that DC motors do not work well with low PWM values
Should you have motors with built in rotary encoders, consider adding PID control
Full discussion here

Let us know how it works (can't test it now)
17  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: February 12, 2014, 09:34:23 am
@Billcat,
Based on your feedback, I will slightly move the joystick on the right, for the next release
I will appreciate you test the app when you have time (no rush smiley-wink)

@nemesis159
I will answer you questions later today
18  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 28, 2014, 05:03:50 am
Quote
I had just been thinking it would be great if there were a few more buttons, and a way to send more data info.  
Do you know if this version would work with my galaxy s3 and if so, is it also available on the google store?

hi Billcat
Check your mail
Six buttons + 4 data bytes  smiley-wink

This is how it looks on my Sony Xperia Mini (3" 320X480)


Please let me have a screen shot from your Samsung galaxy S3 (4.8" 1280X720)

19  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 27, 2014, 03:47:52 pm
Quote
But refuse to pair your app..
Not sure I understand
Pairing is an operation between your phone and the BT card
Apps are not involved in this process
Do you mean "connect" ??
Please clarify
Also let me know at which step (1 to 10) you are getting in trouble

Quote
so i belive the BT Joystick app is not compatible with Android 2.3.5
The app is compatible with Android V2.2 (API level 8 ) and higher

Quote
even so...if i had BT connection i couldn't get any movement ,joystick or Leds.
So you got connected ??
Please clarify

Quote
Could you post the first versions of the Bluetooth Joystick Aplicacion so i can trie it out?
Sure, let me have your email via PM
20  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 24, 2014, 12:30:42 pm
No needs to load any sketch, this is a pure RF affair between Bluetooth module and Android device  smiley-wink
Arduino board is not involved at this stage

 1- Just make sure to connect 3V + Ground to BT board
 2- BT board led should blink red
 3- Pair the Android device with BT board, if not already done
 4- Open BT Joystick Commander
 5- Make sure "Option for advanced users/Auto connect" is unchecked
 6- (exit/relaunch the application if any change)
 7- Press "connect", make sure you see your BT device in the paired section
 8- Select your BT device
 9- BT device led should change from blinking to solid red
 10- Android BT Commander should report: "connected to XXXXXX"

Let me know the outcome
21  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 21, 2014, 01:31:26 am
Quote
This is looking better and better Kas, i belive you should go for the app,...
...,so one again,im telling you,this app will have succes,you should look at how many visit this post had.Nice job..Thank you  smiley-wink
Thanks juycce for the kind word  smiley-cool
The App is ready, but rather demanding in term of processing power (bluetooth + wifi)
Together with tolisn63 we are busy optimising the code

@all
Any candidate as a second beta tester ??
required:
 - high end tablet (google, Samsung...)
 - a different IP camera (not Wanscam)
22  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 17, 2014, 02:51:17 am
Quote
Works perfect!  Thanks for the fix, I am now able to do what I want with the leds I mentioned
@billcat
Glad it now works  smiley smiley smiley

@all
AndroLEDV10.2 introduced a nasty bug: buttonStatus was both declared as global and local
buttonStatus (global) was therefore never updated  smiley-red
Please  discard V10.2 and download V10.3 (see reply #129)

Quote
Now I need to address the r/c servo scenario. I will try to figure it out myself first, but will probably end up needing advice on that later
Joystick Bluetooth Commander was specificaly developped for driving up to two r/c servo's. should you have any problem with the code, please ask  smiley-wink


Quote
I just now noticed your recent proposed "total rc commander", which looks   smiley-grin smiley-grin smiley-grin.  I had just been thinking it would be great if there were a few more buttons, and a way to send more data info.  
Do you know if this version would work with my galaxy s3 and if so, is it also available on the google store?
Total RC Commander (with video stream display) is in development with tolisn63 support, now nearly ready
I invested quite a lot of time (and some money) in this project  smiley-roll
My plan is to propose this application on Google Store for a couple of bucks, but I am concerned by Google privacy policy...

@all
Should you be interested by this App, please contact me via PM
23  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 15, 2014, 12:30:27 pm
Quote
Great News

I got it working with this URL
http://IPaddress:port/videostream.cgi?user=admin&pwd=&resolution=32&rate=0

Now, let me think out-loud some functionality questions if I may.

1. is it possible to increase the number of buttons ?
2. What data can the controller poll?
can I split it up and show for example
Battery=
Heading=
Lasers=
Mode=
Control=
e.t.c

3. Can you increase the video size ?
4. Can you decrease the size of the joystick ? (to conserve space ?)
5. Can you add another option so instead of a joystick it shows 4 arrows to control the bot?
6. Is it possible to include toggle indicators ?

Sorry for all the loud thinking but I'm really exited with this. I was searching for something like this for a long time.
Thanks very much for all you hard work and sharing

OK  smiley-wink

Previous design:



Proposed layout based on your comments:


 - 640X480 video stream
 - 1 joystick
 - 6 buttons (latch or momentary)
 - 4 robot parameter displays sent back from Arduino (voltage, heading, rpm, temp ...)


Quote
Actually I had to lower the resolution of the camera (320x240) because there was a terrible video lag of about 1 second or so
I don't get any lag with my Xperia Mini configured as an IP camera, check your camera settings, you may have to reduce fps value

Please let me have your comments
Thanks again for your suggestions and your positive feedback  



24  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 14, 2014, 04:25:34 pm
Quote
best wishes and thanks again for the cool app
Thanks billcat
Please let us have your feedback whenever you can
25  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 13, 2014, 09:47:43 am
Hi billcat

I finally could reproduce the problem, my fault   smiley-red
Please download and run attached sketch (V10.3)

 - button #1 controls on board LED (D13)
 - button #2 controls debug mode (output to Serial Monitor)
 - button #3 and #4 are just configured as push button (momentary contact)

Please let me know the outcome, especially for button #1
26  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 12, 2014, 03:19:09 pm
Quote
I wonder if you would consider my intentions, and provide some guidance on modifying the code/code snippets to ease me along?

OK

First step

1) Which Arduino board are you using ?

2) download and run this sketch and confirm baurate + firmware version

Code:
// JY-MCU Bluetooth Dongle configurator
// Credit to Jeff Simpson

// Utility will display actual Baud rate and as an option,
// set up a new Baud rate

// TX BT board pin to Arduino D2
// RX BT board pin to Arduino D3
// 5V BT board pin to Arduino 5V
// GND BT board pin to Arduino GND

#include "SoftwareSerial.h"

SoftwareSerial mySerial(2, 3);          // BlueTooth module TX RX
char response[21];                      // responses from module
int rv = 0;                             // return value
boolean found = false;                  // module found
int bps;

void setup()  {
  Serial.begin(57600);
  mySerial.begin(57600);
  delay(300);
  Serial.print("\n\nJY-MCU Bluetooth Dongle configurator ");
  Serial.print("\nSearching ");            // Search for BT module on 12 possible baudrates
  long baud[12] = {1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600, 1382400};
  for(int a = 0; a < 12; a++)
  {  mySerial.begin(baud[a]);
     delay(300);
     mySerial.write("AT");               // "AT" will respond with "OK" if it is working
     delay(20);
     mySerial.readBytes(response, 2);
     delay(20);
     if (strncmp(response, "OK", 2) == 0)
     {  Serial.print("\nBluetooth Module found at BAUD ");
        Serial.println(baud[a]);
        found=true;
        break;
     } else  Serial.print(".");
  }
  if (found==false)
  { Serial.println("\nERROR: Bluetooth Module not responding!");
    Serial.println("Make sure there are no active bluetooth connection and try again");
    while(1);
  }
  
  delay(100);
  mySerial.write("AT+VERSION");           // Check the firmware version
  while(mySerial.available() == 0);
  mySerial.readBytes(response,2);
  if (strncmp(response, "OK", 2)==0)
  { rv = mySerial.readBytes(response, 20);
    response[rv] = 0;
    Serial.print("Firmware Version: ");
    Serial.println(response);
    Serial.println();
  }  else  {  
    Serial.println("Error checking BT Version");
    Serial.println();
    while(1);
  }

  while(Serial.available())   Serial.read();
  Serial.println("To modify Baud rate, enter:");  
  Serial.println("  1  for   1200 bps");  
  Serial.println("  2  for   2400 bps");  
  Serial.println("  3  for   4800 bps");  
  Serial.println("  4  for   9600 bps");  
  Serial.println("  5  for  19200 bps");  
  Serial.println("  6  for  38400 bps");  
  Serial.println("  7  for  57600 bps");  
  Serial.println("  0  to Exit\n");
  Serial.print("Selected: ");
  
  while(Serial.available()==0);
  bps = Serial.read();
  if(bps>=48 & bps<=56)  {    // '0' < bps < '8'
  Serial.println(bps-48);
    if(bps>48)  {
      mySerial.write("AT+BAUD");           // Set the BAUD
      mySerial.write(bps);
      while(mySerial.available()==0);
      mySerial.readBytes(response, 2);
      if (strncmp(response, "OK", 2)==0)  {
        rv = mySerial.readBytes(response, 7);
        response[rv] = 0;
        Serial.print("New BAUD setting: ");
        Serial.println(response);
      }  else  {
        Serial.println("Error Setting BAUD");
        Serial.println(response);
      }
      Serial.println("Bluetooth Setup Completed  ** End **");
      while(1);
    }  else  {
      Serial.println("No modification  ** End **");
      while(1);
    }
  }
  else    Serial.println("non valid entry  ** End **");
}

void loop() { }
Exit code by pressing "0"


3) for the good sake, confirm that the JY_MCU led changes from blinking to solid red when connecting within Android BT Joystick
27  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 11, 2014, 03:01:17 pm
Check your mail
28  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 10, 2014, 01:27:23 pm
Let me have your email via PM
29  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 10, 2014, 10:39:32 am
Quote
Great news, if you want I can also test. I have a wanscam IP camera (similar  to foscam)

Why not  smiley

This a screen shot of "Total RC Commander" V0.1B:

The application is working but for the moment, the screen is optimized only for a 8" tablet
I suspect the application needs at least 7" to display the information correctly
sorry, no phones  smiley-confuse smiley-confuse

Do you have a tablet ??
Please let me have size and resolution
30  Using Arduino / Networking, Protocols, and Devices / Re: Android Bluetooth joystick on: January 10, 2014, 02:17:41 am
Quote
Quote
any chance that you  can add a window to show the feed from a wifi camera? Then we will have the ultimate robot controller
smiley-roll smiley-roll smiley-roll
that's a slightly more complex story  

OK
Did some research, looks definitly doable
I will order a Foscam IP camera which is well supported and documented


I already started development using another android device (Sony Xperia Mini) as an IP camera

Thanks tolisn63 for this smart idea, and... for keeping me busy  smiley-wink
Pages: 1 [2] 3 4 ... 20