How to send and recive data

Status
Not open for further replies.

alex905

New Member
Hi I'm currently in the middle of my first project and i just finished putting it together. it consits of a max232 chip and a SRF02 ultrasonic ranger(its in serial mode).

iv been going though tons of examples on the net but they are all to do with i2c chips and the ranger.

i am a programmer but i don't know c nor have i ever done device communications. so I'm a but stuck, I'm learning c now so feel free to give me code examples in that if you want.

now for my problem. i need to know how to send the following data to the ranger through com1

0x00 (the address of the ranger)
0x51 (tell the ranger to range in centermeters)
then i should wait 70ms and then ask for the results in a smiler fashion

0x00 (the address of the ranger)
0x5E ( Get Range, returns two bytes (high byte first) from the most recent ranging.) that was taken from the website i brought it from.

here is the spec link with all the hex code and probably more information that i have put in so far.

https://www.robot-electronics.co.uk/htm/srf02techSer.htm

so how would i send the data to the device and how would i receive it. also what references(headers) do i need to make it work.

sorry if this was a but long but I'm trying to be thourough.

thanks for reading

Alex Wood
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…