PDA

View Full Version : Float values in RXBUFFER


mohanarpit
04-04-08, 01:00 PM
Hi

I went throught the entire conversation in the earlier question. I had a query. I have attached a Compass Sensor purchased from "Ocean Server" to the Isopod. The Compass Sensor returns back 4 float values ( Heading, Pitch, Roll and Temperature) along with the prefixes as shown in an example output.

Eg. $C28.3P58.5R-54.6T28.3*37
(where c = compass, p= pitch, r=roll, t=temperature)

I don't have to poll these results. The sensor continously sends back results when connected to the serial port. I was wondering if it is possible to store these values in a buffer and access them later?

RMDumse
04-05-08, 12:39 PM
Certainly it is possible to save this in a buffer. I can think of several ways to approach it.

Turning on the interrupt buffers would be a good start. RXBUFFER is used for that purpose. You can search this forum for answers on that.

The RXBUFFER would give you a circular buffer. If you made it 3 times as large as the sentence you got from your equipment, you could be sure to pull out at least one good copy of the sentence.

To get it I'd start stripping characters until I got a $, then convert the floats to the end of the string.

mohanarpit
04-09-08, 01:17 PM
Thanks!
I'll try it out ...

Arpit