Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 11th April 2008, 08:30 PM   (permalink)
Default How to send and recive data

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.

http://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
alex905 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Serial communication problems amindzo Micro Controllers 3 29th August 2006 12:29 PM



All times are GMT. The time now is 01:16 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.