new software serial library problems

So I’ve been trying to use this new software serial software library but I’m getting the wrong output. I’m trying to connect an OS-5000S digital compass using the software serial port. I’m pretty sure my pin configuration is correct, and the compass outputs comma delimited data as a string of characters it seems: e.g. 192.6, 193.5, 196.4…
This is my current code:
#include <NewSoftSerial.h>

#define rxPin 4
#define txPin 5
NewSoftSerial CompassSerial(rxPin, txPin);
int compass;
int test;
int i = 0;
int j = 0;
void setup() {

pinMode(txPin, OUTPUT);
pinMode(rxPin, INPUT);
CompassSerial.begin(4800);
Serial.begin(38400);
}

void loop() {
if(CompassSerial.available()) {
//if(CompassSerial.read()==46) {
//for(i = 0; i<6; i++) {
compass = CompassSerial.read();

Serial.println(compass);
//}
//}
}
// if(CompassSerial.available()) {
// Serial.println(“Hello”);
// if(CompassSerial.read() == 10) {
// Serial.println(“Hello There”);
// while(1) {
// compass = CompassSerial.read();
// if(compass == ‘,’) {
// break;
// }
// i++;
// }
// }
// Serial.println(“Hello There2”);
// }
// for(j = 0; j < 6; j++) {
// Serial.println(“Hello There3”);
// CompassSerial.print(compass[j]);
// }
}

So basically I’m just printing out whatever I get, which is:
×
§
·
Û
×
«
¯
·
·
Û
ß
«
Ó
·
ß
ß
§
¯
÷
ï
Û
ß
×
«
×
·
·
Û
×
«
×
·
·
Û
ß
§
Ó
·
ß
ß
«
¯
÷
ï
Û
ß
×
«
ß
·
·
Û
×
§
×
·
·
ß
ß
«
Ó
·
Û
ß
«
¯
÷
ï
Û
ß
×
§
Ó
·
·
Û
×
«
×
·
·
Û
ß
«
×
·
Û
ß
«
¯
÷
ï
Û
¤
I
%
*_ _*
*_ _*
*_ _*
*_ _*%*_ _*
*_ _*
*_ _*
$
v

which seems to be junk…can anyone help??
Thanks in advnce

looks like a baud rate problem....

On page 11 of the manual I found here

http://www.oceanserver-store.com/compass.html

It states that the factory default baud rate is 19200.

In your code it looks like you set it to 4800.

Sorry I forgot to mention that I set the baud rate to 4800 connecting the compass directly to a computer and programming it from there. It should remember the settings even after the power is lost. Any other suggestions? Thnanks!

uploaded program on gps using the above code on duelmineuve code says error on uploading 27: error: NewSoftSerial.h: No such file or directory In function 'void setup()': In function 'void loop()': Bad error line: -3

That’s telling you that you need to install the NewSoftSerial library in the proper place. Have you done that, or tried to?

That’s telling you that you need to install the NewSoftSerial library

If…

#include <NewSoftSerial>

… isn’t enough, then you possibly need to install the library, too.

Details of that, admittedly in a different context, and related issues at…

http://sheepdogguides.com/arduino/ar3ne1libs.htm

@tkbyd I think you're missing something in your include statement. Like the .h...