Help with compass project

Hi every one ;

I have 3d compass from Rion-tech.com its name HCM505B RS-232
and I need to get data from it to my Arduino UNO
I make a circuit that will transfere from TTL to RS232 using MAX232 and i test it and finally work
so just my problem now is how to send this “68 04 00 04 08” command to the compass from arduino and how to translate the recived command from compass

so can any one help me please . .
I know that is a very simple thing for experts but I am beginner to arduino

datasheet
http://www.rion-tech.net/uploadfile/20130110/20130110092946290.pdf

I use arduino uno and here is my code;

#include <SoftwareSerial.h>

SoftwareSerial mySerial(6, 7); // RX, TX

void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial) {
;
}

Serial.println(“Goodnight moon!”);

// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
mySerial.println(“Hello, world?”);
}

void loop() // run over and over
{

if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}

Evidently, since January you’ve made no progress, so every few months you post basically the same question?

I will try to help, but im not experienced either,

Fisrtly, the spec sheet states :
"Send thee calibration calibration start sar command: command: 68 04 00 08 0C in hexadecimal format.
(Orr click cc thee Rionon’s 3Ddebugging debugging software software "CALI-START" "CALI-START" button) button)"

I would begin by makign sure the sensor works in the application, then I would take a trusted Terminal dialogue program and would try to send it this command manually. If that works, then I would move on to trying with the arduino,

Do we assume that you have worked out how to use the sensor?

Also you state you are trying to send 66 04 00 04 08, what is this meant to do ? cant see it on the list of commands.

common guys this fourm is for help Arduino users from begginers to experts
I have no body to ask

Any one need gave a help so thanks for him and any one don't want so leave this page and let him mockering in another fourms

Evidently, since January you've made no progress, so every few months you post basically the same question?
Help Arduino to 3 axis compass - Project Guidance - Arduino Forum
Compass , getting data - Project Guidance - Arduino Forum

I started my project from January it has several parts I made all of them and still the control one, thats why I was late

thank you spruce_m00se for responde

Now I was able to send the request dta command

I connect my laptop through arduino to PC through rs232 and use REALTERM program to make sure that my command right

this is the new program

/*
Software serial multple serial test

Receives from the hardware serial, sends to software serial.
Receives from software serial, sends to hardware serial.

The circuit:

  • RX is digital pin 10 (connect to TX of other device)
  • TX is digital pin 11 (connect to RX of other device)

Note:
Not all pins on the Mega and Mega 2560 support change interrupts,
so only the following can be used for RX:
10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69

Not all pins on the Leonardo support change interrupts,
so only the following can be used for RX:
8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

created back in the mists of time
modified 25 May 2012
by Tom Igoe
based on Mikal Hart’s example

This example code is in the public domain.

*/
#include <SoftwareSerial.h>

SoftwareSerial mySerial(6, 7); // RX, TX

void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

Serial.println(“Goodnight moon!”);

// set the data rate for the SoftwareSerial port
mySerial.begin(9600);

}

void loop() // run over and over
{

mySerial.write(0x68);
mySerial.write(0x04);
mySerial.write(0x6800);
mySerial.write(0x04);
mySerial.write(0x08);

if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());

delay(1000);
}

but also I still have no respond in arduino terminal
any help

what i need is to know how to recieve hex data and translate it to dec values

Please use code tags (use the “#” button) so that your code looks like the following line:

mySerial.write(0x6800);

which, incidentally, will not work the way you intend. “0x6800” is a 16 bit value and unless you specify the buffer length, you can send only single characters (8 bit values) using Serial.write. Read about it here: http://arduino.cc/en/Serial/write

You obviously could do a lot more reading about how to program the Arduino and that way, you will help yourself.

Edit:

what i need is to know how to recieve hex data and translate it to dec values

Data are BINARY. You can interpret or represent those binary values in various different ways, such as hex, decimal, ASCII characters, etc.

Now I can recive the data automatically because I change the sensor mode to auto output
, so I don’t need to send request command and I tried it on pc computer with rs232 port with real term prog and it works data begin flows in 25 hz

but I open Arduino serial after connecting the sensor throgh max232 to arduino and I didn’t see any chars apears??

and here is my code;

#include <SoftwareSerial.h>
SoftwareSerial mySerial(6, 7); // RX, TX

void setup()  
{
  Serial.begin(9600);
  while (!Serial) {
    ;}
  Serial.println("Test");
  mySerial.begin(9600);

}

void loop() // run over and over
{

  if (mySerial.available())
  Serial.print(mySerial.read());
}