Show Posts
Pages: 1 [2]
16  Forum 2005-2010 (read only) / Troubleshooting / Re: Serial Communication on: April 30, 2009, 01:02:14 am
well THANK YOU so much mdowning   I cannot believe it was so simple. You dont know how many hours went into this. So now I just need to pull off the data into readable numbers for acceleration and angular rate? I am still abit unsure how to seperate this out, but this definitely puts me forward to the next step.
17  Forum 2005-2010 (read only) / Troubleshooting / Re: Serial Communication on: April 30, 2009, 12:53:46 am
Update: i got the unit to run in continuous mode now so i know i have a lot of data coming at me. i am now using the following: i cleared up the comments so it is clear. I am now getting 32 1s do to the binary output. any suggestions to get more readable data? should i make a pure transmit pin (not pin 1) and the receive pin as 0 to ensure there is no interference when i write "i receive" ?


#include <NewSoftSerial.h>

//===========================================================================
// SetContinuousMode
//---------------------------------------------------------------------------
// Start continuous mode
//===========================================================================

NewSoftSerial SerialIn(0, 1);

int incomingByte = 0;      // for incoming serial data
  
void setup(){
  //pinMode(Tx, OUTPUT);
 // pinMode(Rx, INPUT);
  SerialIn.begin(115200);      // opens serial port, sets data rate
  //delay(100);
 
  byte a = B11000100;  //binary for 0xC4
  SerialIn.print(a);
  byte b = B11000001;   //binary for 0xC1
  SerialIn.print(b);
  byte c = B00101001;  //binary for 0x29
  SerialIn.print(c);
  byte d = B11000010;  //binary for 0xC2
  SerialIn.print(d);


 
 if (SerialIn.available() >= 0) {
 

 }
}
//delay (100);

void loop() {

      // send data only when you receive data:
      
            // read the incoming byte:
            incomingByte = SerialIn.read();

            // say what you got:
            SerialIn.print("I received: ");
            SerialIn.println(incomingByte, BIN);
      
}

Thanks
18  Forum 2005-2010 (read only) / Troubleshooting / Re: Serial Communication on: April 26, 2009, 05:36:08 pm
start the serial port?

if it is wrong, I would still get the light to flash on on the Inertia Link signifying a data byte received?
19  Forum 2005-2010 (read only) / Troubleshooting / Re: Serial Communication on: April 26, 2009, 05:04:43 pm
well thank you. this was not my latest progress but the coding is generically the same. The software serial was not used and forgot to comment it out on this one. Dont worry about the comments but the content of the code for I want 115200 baud rate to communicate with the Inertia Link. The code works enough to send a command signal "0xC2" out to the Inertia Link. The protocal manual says it needs to be a command byte of 0xC2. So instead of char c = 0xC2, should it be byte c = 0xC2?

does the output of a square O, y with two dots over it, and a A with a carot over it mean anything?
20  Forum 2005-2010 (read only) / Troubleshooting / Re: Serial Communication on: April 25, 2009, 05:27:56 pm
well thanks. here is what i have but dont see a response.

#include <SoftwareSerial.h>
 
#include <NewSoftSerial.h>
 
 
int Tx = 1;                 // Set Tx to 1
int Rx = 0;
int incomingByte = 0;     // for incoming serial data
 
 
void setup()
{
  pinMode(Tx, OUTPUT);      // sets the digital pin as output
  pinMode(Rx, INPUT);
char c = (0xC2);              //44 equal Hex 2C
Serial.print(c);
delay(1000);
 
 
            Serial.begin(115200);      // opens serial port, sets data rate to 9600 bps
}
 
void loop() {
 
            // send data only when you receive data:
            if (Serial.available() >= 0) {
                        // read the incoming byte:
                        incomingByte = Serial.read();
 
                        // say what you got:
                        Serial.print("I received: ");
                        Serial.println(incomingByte, DEC);
            }
}
21  Forum 2005-2010 (read only) / Troubleshooting / Serial Communication on: April 25, 2009, 09:39:21 am
For a senior project, I am trying to get an Arduino Duemilanove to talk to a Microstrain InertiaLink unit (a 3 axis accelerometer and 3 axis gyroscopes). I have a MAX 232 chip installed to insure the two units talk in TTL language. How can I send a command "0xC2" which is the initiating command to prompt the Microstrain unit to output acceleration and angular rates?

Thank you
22  Forum 2005-2010 (read only) / Troubleshooting / Microstrain Inertia Link setup with Duemilanove on: April 26, 2009, 01:23:05 pm
Progress report is that I was able to get the microcontroller to send a command to the Microstrain. The command "0xC2" is needed to initiate communication before the Microstrain will output data. It's default is polled mode so I should be receiving data but I only get a square O, a y with two dots over it, and an A with a carot over it. Anyone know what this means? Please help

I used the following

//#include <SoftwareSerial.h>

#include <NewSoftSerial.h>

int Tx = 1;                 // Set Tx to 1
int Rx = 0;
int incomingByte = 0;      // for incoming serial data


void setup()
{
  pinMode(Tx, OUTPUT);      // sets the digital pin as output
  pinMode(Rx, INPUT);
  Serial.begin(115200);      // opens serial port, sets data rate to 9600 bps
  delay(5000);
  
  char a = 0xC2;

  Serial.print(a);  

delay (1000);
}

void loop() {

      // send data only when you receive data:
//      if (Serial.available() >= 0) {
            // read the incoming byte:
//            incomingByte = Serial.read();

            // say what you got:
//            Serial.print("I received: ");
//            Serial.println(incomingByte, BYTE);
//      }
}

23  Forum 2005-2010 (read only) / Troubleshooting / Serial Communication on: April 25, 2009, 12:10:50 am
For a senior project, I am trying to get an Arduino Duemilanove to talk to a Microstrain InertiaLink unit (a 3 axis accelerometer and 3 axis gyroscopes). I have a MAX 232 chip installed to insure the two units talk in TTL language. How can I send a command "0xC2" which is the initiating command to prompt the Microstrain unit to output acceleration and angular rates?

After this is successful, I have the following code for RECEIVING data from the Microstrain written in C code when communicating with a PC which needs transformation to be accepted by the Arduino.

      //acceleration
      pRecord->accelX = FloatFromBytes(&response[1]); //bytes 1..4
      pRecord->accelY = FloatFromBytes(&response[5]); //bytes 5..8
      pRecord->accelZ = FloatFromBytes(&response[9]); //bytes 9..12

      //Angular Rate
      pRecord->angRateX = FloatFromBytes(&response[13]); //bytes 13..16
      pRecord->angRateY = FloatFromBytes(&response[17]); //bytes 17..20
      pRecord->angRateZ = FloatFromBytes(&response[21]); //bytes 21..24


Any help would be greatly appreciated. Thank you
24  Forum 2005-2010 (read only) / Troubleshooting / Re: Microstrain Inertia Link setup with Duemilanove on: April 21, 2009, 11:00:43 am
well i was hoping to initiate the communication to see if something happens. is this a chip necessary? so there is no way around this? we are trying to build a rocket and all programming is essentially complete but the communication with the Inertia Link is holding me up.

Thank you
25  Forum 2005-2010 (read only) / Troubleshooting / Microstrain Inertia Link setup with Duemilanove on: April 21, 2009, 02:07:09 am
hey guys i could really use your help for a senior project. i got it to move servos but my problem is that i have Microstrain Inertia Link but cannot get it to talk to the duemilanove which our team just bought. i tried the serial.read and other codes i found online and i cannot get anything from it. From an individual online, i found the following to start the proper format to which i could add too but i still get nothing. from the source code available from Microstrain, a coding involving 0xC2 for acceleration and angular rates will be necessary but i want to know first how to get anything from it. ANY HELP WOULD BE GREATLY APPRECIATED. Thanks

#include <NewSoftSerial.h>

NewSoftSerial imu(7, 5);

void setup()
{
  imu.begin(9600);

  Serial.begin(9600);
}

void loop()
{

    if (imu.available())
    {
      Serial.print("IMU: ");
      Serial.print(imu.read(), BYTE);
    }

}
26  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: serial on different pins than 0 or 1 on: April 25, 2009, 01:18:31 am
How do you even transmit data out of a pin? i cannot get anything to work. when i think i am transmitting, i can unplug the usb cord and get errors. I have a Duemilanove and tried serial.write  , digitalWrite and got nothing. Any help would be greatly appreciated.

Thank you
Pages: 1 [2]