Author Topic: Bluesmirf Roboduino recieves input but not moving still  (Read 1762 times)

0 Members and 1 Guest are viewing this topic.

Offline offyTopic starter

  • Supreme Robot
  • *****
  • Posts: 340
  • Helpful? 1
Bluesmirf Roboduino recieves input but not moving still
« on: April 28, 2009, 04:39:13 AM »
So I had my robot though the USB on roboduino so I could use W,A,S,D to move it. It worked out good. So I got my bluesmirf hooked up and now it gets signals but it doesn't do anything. I see the RX and TX led's light up, and nothing works. How does the bluesmirf recieve data? Does it take acsii to what it is or what? I have been having the worst time with this.

-Thanks in advance.

Offline Qubix

  • Full Member
  • ***
  • Posts: 55
  • Helpful? 1
Re: Bluesmirf Roboduino recieves input but not moving still
« Reply #1 on: April 28, 2009, 05:31:13 AM »

Three things you should check

1, Make sure you have RX and TX the right way around.
2, You are using the right baud rate ( I think the bluesmirf is default 9600, but can be changed).
3, Also you should to connect CTS and RTS together if you are not using them for handshaking of some sort.

Hope this helps  :)

David
http://robots.ie  - Ireland's robot site

Offline offyTopic starter

  • Supreme Robot
  • *****
  • Posts: 340
  • Helpful? 1
Re: Bluesmirf Roboduino recieves input but not moving still
« Reply #2 on: April 28, 2009, 12:48:10 PM »
I have all of that. Does the bluesmirf take the input and process it to Hex or Acsii?

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: Bluesmirf Roboduino recieves input but not moving still
« Reply #3 on: April 28, 2009, 05:22:37 PM »
show us your code

Offline offyTopic starter

  • Supreme Robot
  • *****
  • Posts: 340
  • Helpful? 1
Re: Bluesmirf Roboduino recieves input but not moving still
« Reply #4 on: April 28, 2009, 07:29:40 PM »
This is the code
Code: [Select]
#include <Servo.h>
#include <SoftwareServo.h>
Servo right;
Servo left;
SoftwareServo head;
SoftwareServo right_main;
SoftwareServo right_side;
SoftwareServo left_main;
SoftwareServo left_side;
int right_arm_side = 0;
int right_arm_side1 = 180;
int right_arm_main = 0;
int right_arm_main1 = 180;
int left_arm_side = 0;
int left_arm_side1 = 180;
int left_arm_main = 0;
int left_arm_main1 = 180;
int headValue = 0;
int headValue1 = 180;
char val;
void setup() {
  right.attach(9);
  left.attach(10);
  head.attach(11);
  right_main.attach(5);
  right_side.attach(3);
  left_main.attach(6);
  left_side.attach(8);
  Serial.begin(9600);
}
void loop() {
 if( Serial.available() )       // if data is available to read
  {
    val = Serial.read();         // read it and store it in 'val'
  }
  if( val == 'A' )
  {
    left.write(135);
    right.write(135);
  }
  if( val == 'D' )
  {
    left.write(45);
    right.write(45);
  }
  if( val == 'W' )
  {
    left.write(45);
    right.write(135);
  }
  if( val == 'S' )
  {
    left.write(95);
    right.write(95);
    delay(250);
    left.write(135);
    right.write(45);
  }
  if( val == ' ' )
  {
    left.write(96);
    right.write(97);
  }
  if( val == 'E' )
  {
   headValue = headValue + 100;
   head.write(headValue);
   SoftwareServo::refresh();
  }
   if( val == 'Q' )
  {
   headValue1 = headValue1 - 100;
   head.write(headValue1);
   SoftwareServo::refresh();
  }
  if( val == 'F' )
  {
    right_arm_side1 = right_arm_side1 - 5;
    right_side.write(right_arm_side1);
    SoftwareServo::refresh();
  }
  if( val == 'H' )
  {
    right_arm_side = right_arm_side + 5;
    right_side.write(right_arm_side);
    SoftwareServo::refresh();
  }
    if( val == 'T' )
  {
    right_arm_main1 = right_arm_main1 - 5;
    right_main.write(right_arm_main1);
    SoftwareServo::refresh();
  }
  if( val == 'G' )
  {
    right_arm_main = right_arm_main + 5;
    right_main.write(right_arm_main);
    SoftwareServo::refresh();
  }
    if( val == 'J' )
  {
    left_arm_side1 = left_arm_side1 - 5;
    left_side.write(left_arm_side1);
    SoftwareServo::refresh();
  }
  if( val == 'L' )
  {
    left_arm_side = left_arm_side + 5;
    left_side.write(left_arm_side);
    SoftwareServo::refresh();
  }
    if( val == 'K' )
  {
    left_arm_main1 = left_arm_main1 - 5;
    left_main.write(left_arm_main1);
    SoftwareServo::refresh();
  }
  if( val == 'I' )
  {
    left_arm_main = left_arm_main + 5;
    left_main.write(left_arm_main);
    SoftwareServo::refresh();
  }
  delay(1);
  }

Offline Qubix

  • Full Member
  • ***
  • Posts: 55
  • Helpful? 1
Re: Bluesmirf Roboduino recieves input but not moving still
« Reply #5 on: April 29, 2009, 05:29:32 AM »
Connect RX and TX on the bluesmirf together and send "A" through hyperterminal and see what comes back
http://robots.ie  - Ireland's robot site

Offline offyTopic starter

  • Supreme Robot
  • *****
  • Posts: 340
  • Helpful? 1
Re: Bluesmirf Roboduino recieves input but not moving still
« Reply #6 on: April 29, 2009, 12:44:01 PM »
Why would I connect them, it will not be able to connect or anything.

Also I don't use hyper terminal, I use gtkterm on ubuntu.
« Last Edit: April 29, 2009, 02:34:02 PM by offy »

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Re: Bluesmirf Roboduino recieves input but not moving still
« Reply #7 on: April 29, 2009, 03:10:52 PM »
It will be able to connect, it is just connecting with itself. If you connect RX and TX on the bluesmirf, if you send 'A' the bluesmirf will send it out and receive it, so on your computer it will show up as 'A'.

Did you read the UART and bluetooth tutorials? It's all in there.

Offline offyTopic starter

  • Supreme Robot
  • *****
  • Posts: 340
  • Helpful? 1
Re: Bluesmirf Roboduino recieves input but not moving still
« Reply #8 on: April 29, 2009, 03:52:12 PM »
I read some of it. I will try the rx to tx right now. I will update in a few.

Nothing shows up.
« Last Edit: April 29, 2009, 05:16:09 PM by offy »

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Bluesmirf Roboduino recieves input but not moving still
« Reply #9 on: April 30, 2009, 12:26:10 AM »
then the bluesmirf is probably gone.
Howdy

Offline offyTopic starter

  • Supreme Robot
  • *****
  • Posts: 340
  • Helpful? 1
Re: Bluesmirf Roboduino recieves input but not moving still
« Reply #10 on: April 30, 2009, 06:27:44 AM »
Damn not again. I hate sending it back to robotshop, it takes them so long.

Offline Qubix

  • Full Member
  • ***
  • Posts: 55
  • Helpful? 1
Re: Bluesmirf Roboduino recieves input but not moving still
« Reply #11 on: April 30, 2009, 11:59:41 AM »
I'd try the same test (connecting tx and rx) at different common baud rates (4800,9600, etc, just to make sure. Like Razor Concepts said , you really should get back what you sent out in your terminal program.

Since the RX and TX leds are lighting up it would seem like something is passing through it.
http://robots.ie  - Ireland's robot site

Offline Qubix

  • Full Member
  • ***
  • Posts: 55
  • Helpful? 1
Re: Bluesmirf Roboduino recieves input but not moving still
« Reply #12 on: April 30, 2009, 12:05:23 PM »
I read the datasheet (for the newest module) it says 115,200 is the default baud . You are using 9600 in your code.  Could be your problem

David

http://www.sparkfun.com/datasheets/Wireless/Bluetooth/rn-bluetooth-um.pdf
http://robots.ie  - Ireland's robot site

 


Get Your Ad Here

data_list