Show Posts
Pages: 1 ... 21 22 [23]
331  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: IMU 6DOF + GPS TTL communucation problems on: April 07, 2009, 12:21:09 pm
hey! sending 007 BYTE worked. now it's streaming data. illegible data but still that's something.
332  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: IMU 6DOF + GPS TTL communucation problems on: April 07, 2009, 12:19:09 pm
apparently if you send anything to the imu it sends back this response. ???êe2É@?S®kÅr²P·Kíi·WH#      
ý¶sZ©ÕnºMC!Ð?j?¦¥7Î+AR°W¶¢-?K&I?%?C??kJñpKÊ¡)ÅÅÙ5AK?ëÅáAAjj4Õí+A6J¶áÕ)ÅÅ5AKAA?ÙL? and then waits. ctrl g is appearently HEX 7 or DEC 7 but it doesn't matter, i still get the same result.
333  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: IMU 6DOF + GPS TTL communucation problems on: April 07, 2009, 12:07:42 pm
ok. using this code i just get "2242240" every time i hit reset on the IMU. or, if i change it to "Serial.print(imu.read(), BYTE);" i get "àà" plus a box character.
the manual says; "When the 6-DOF v2 powers up, the first thing you'll see is the configuration menu. You are presented with 3 options for configuration: Sensor range, output type and the active channel list. Just hit “1”, “2” or “3” to enter the submenu of your choice, or hit “<ctrl>g” to start the unit sampling."
how do you send “<ctrl>g”? i tried sending it as a string like you see commented out in the code. when i did that i would get much longer strings of random ascii characters but only sometimes. it definately wasn't a continuous stream of data.

Code:
#include <NewSoftSerial.h>

NewSoftSerial gps(2, 3);
NewSoftSerial imu(5, 7);

void setup()
{
  imu.begin(57600);
  //gps.begin(38400);
  Serial.begin(57600);
  //delay(1000);
  //imu.print("<ctrl>g");
}

void loop()
{
  // Every 10 seconds switch from
  // one serial GPS device to the other
  /*if ((millis() / 10000) % 2 == 0)
  {
    if (gps.available())
    {
      Serial.print(gps.read(), BYTE);
    }
  }

  else
  {
    if (imu.available())
    {      
      Serial.print(imu.read(), BYTE);
    }
  }*/
  if (imu.available())
    {      
      Serial.print(imu.read());
    }
}
 

334  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: IMU 6DOF + GPS TTL communucation problems on: April 07, 2009, 02:49:15 am
i tried that too.
Code:
#include <NewSoftSerial.h>

NewSoftSerial gps(2, 3);
NewSoftSerial imu(5, 7);

void setup()
{
  imu.begin(38400);
  gps.begin(38400);
  Serial.begin(9600);
}

void loop()
{
  // Every 10 seconds switch from
  // one serial GPS device to the other
  /*if ((millis() / 10000) % 2 == 0)
  {
    if (gps.available())
    {
      Serial.print(gps.read(), BYTE);
    }
  }

  else
  {
    if (imu.available())
    {      
      Serial.print(imu.read(), BYTE);
    }
  }*/
  if (imu.available())
    {      
      Serial.print(imu.read(), BYTE);
    }
}
 


i receive a short burst of data (which is supposed to be the root menu) every time i hit the reset button on the imu but its always just a handful of illegible ascii characters. i've tried every baud rate from 9600-115200. i just get different ascii characters depending on the baud rate i pick. 57600 is the default according to the manual.
335  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: IMU 6DOF + GPS TTL communucation problems on: April 06, 2009, 12:10:53 pm
FINALLY got something. i changed the gps baud rate to 38400bps, out of pure randomness, and now i get legible GPS strings. the manual clearly states the default is 4800bps. i still need to get data from the IMU. to do that i need to see the menu that it sends on startup but i get nothing.
Code:
#include <NewSoftSerial.h>

NewSoftSerial gps(2, 3);
NewSoftSerial imu(7, 5);

void setup()
{
  imu.begin(9600);
  gps.begin(38400);
  Serial.begin(9600);
}

void loop()
{
  // Every 10 seconds switch from
  // one serial GPS device to the other
  if ((millis() / 10000) % 2 == 0)
  {
    if (gps.available())
    {
      Serial.print(gps.read(), BYTE);
    }
  }

  else
  {
    if (imu.available())
    {
      Serial.print("IMU: ");
      Serial.print(imu.read(), BYTE);
    }
  }
}
 
336  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: IMU 6DOF + GPS TTL communucation problems on: April 06, 2009, 11:47:35 am
i looked through the manual and specs several times and didn't see any indication of either. it just says it uses TTL. where would i find code to test either scenario?
337  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: IMU 6DOF + GPS TTL communucation problems on: April 06, 2009, 10:35:41 am
in fact, i've tried every gps example code i could find with the same result. either nothing or illegible characters. i've got the 32 Channel San Jose Navigation GPS 5Hz Receiver with Antenna from sparkfun. aslo called the FV-M8. should work like all the others if connected properly.
338  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: IMU 6DOF + GPS TTL communucation problems on: April 06, 2009, 09:57:29 am
ok i tried it and i still basically have the same problem. i can get data from the gps, but it's not gps strings like it should be. just single random ascii characters or bytes. i get nothing from the IMU (because it's waiting on me but i can't see it's menu.) here's the code:
Code:
#include <NewSoftSerial.h>

NewSoftSerial gps(3, 2);
NewSoftSerial imu(7, 5);

void setup()
{
  imu.begin(9600);
  gps.begin(9600);
  Serial.begin(9600);
}

void loop()
{
  // Every 10 seconds switch from
  // one serial GPS device to the other
  if ((millis() / 10000) % 2 == 0)
  {
    if (gps.available())
    {
      Serial.print("GPS: ");
      Serial.print(gps.read(), BYTE);
    }
  }
  
  else
  {
    if (imu.available())
    {
      Serial.print("IMU: ");
      Serial.print(imu.read(), BYTE);
    }
  }
}
339  Forum 2005-2010 (read only) / Frequently-Asked Questions / IMU 6DOF + GPS TTL communucation problems on: April 06, 2009, 12:58:48 am
i want to use my Duemilanove to recieve IMU 6DOF TTL data along with GPS data at the same time. I'm trying to use the SoftwareSerial Library with no luck. for now, to simplify the problem, i'm just trying to receive data from either unit by itself. here is the code:
Code:
#include <ctype.h>

#define bit9600Delay 84  
#define halfBit9600Delay 42
#define bit4800Delay 188
#define halfBit4800Delay 94

byte rx = 4;
byte tx = 6;
byte SWval;

void setup() {
  Serial.begin(9600);
  pinMode(rx,INPUT);
  pinMode(tx,OUTPUT);
}

void loop()
{
    SWval = SWread();
    Serial.print(SWread());
}

void SWprint(int data)
{
  byte mask;
  //startbit
  digitalWrite(tx,LOW);
  delayMicroseconds(bit9600Delay);
  for (mask = 0x01; mask>0; mask <<= 1) {
    if (data & mask){ // choose bit
     digitalWrite(tx,HIGH); // send 1
    }
    else{
     digitalWrite(tx,LOW); // send 0
    }
    delayMicroseconds(bit9600Delay);
  }
  //stop bit
  digitalWrite(tx, HIGH);
  delayMicroseconds(bit9600Delay);
}

int SWread()
{
  byte val = 0;
  while (digitalRead(rx));
  //wait for start bit
  if (digitalRead(rx) == LOW) {
    delayMicroseconds(halfBit9600Delay);
    for (int offset = 0; offset < 8; offset++) {
     delayMicroseconds(bit9600Delay);
     val |= digitalRead(rx) << offset;
    }
    //wait for stop bit + extra
    delayMicroseconds(bit9600Delay);
    delayMicroseconds(bit9600Delay);
    return val;
  }
}
reading the gps data just gives me infinite strings of bytes and the IMU doesn't communicate at all because it's waiting for my input which i'm unable to give. the IMU is supposed to start up with a menu where you select different options and send <ctrl> g to tell the unit to start sending data. of course, i don't get to see the menu because the code does not communicate with it correctly so i get nothing.
340  Forum 2005-2010 (read only) / Frequently-Asked Questions / How do i get multiple serial inputs/outputs? on: April 05, 2009, 11:50:20 am
it appears the duemilanove only has one set of Rx Tx ports. I need multiple. I want to recive GPS data, IMU data, and send Pololu Servo command data. and ideas?
Pages: 1 ... 21 22 [23]