how to change the range in the SRF08 ultrasonic?
eddiech
Posts: 2
hi,
I have a problem with changing the range in SRF08 ultrasonic rangefinder.
Here is my code. I want to reduce the range. Are there any problems in my code?
I use CCS Complier to complie. Thank for any reply.
·· i2c_start();
·· i2c_write(address);
·· i2c_write(0x00);
·· i2c_write(0x51);
·· i2c_start();
·· i2c_write(address);
·· i2c_write(0x01);
·· i2c_write(0x00);
·· i2c_start();
·· i2c_write(address);
·· i2c_write(0x02);
·· i2c_write(0x01);
·· delay_ms(70);
·· i2c_start();
·· i2c_write(address+1);
·· i2c_read(1);
·· rangehigh = i2c_read(1);
·· rangelow· = i2c_read(0);
·· i2c_stop();
I have a problem with changing the range in SRF08 ultrasonic rangefinder.
Here is my code. I want to reduce the range. Are there any problems in my code?
I use CCS Complier to complie. Thank for any reply.
·· i2c_start();
·· i2c_write(address);
·· i2c_write(0x00);
·· i2c_write(0x51);
·· i2c_start();
·· i2c_write(address);
·· i2c_write(0x01);
·· i2c_write(0x00);
·· i2c_start();
·· i2c_write(address);
·· i2c_write(0x02);
·· i2c_write(0x01);
·· delay_ms(70);
·· i2c_start();
·· i2c_write(address+1);
·· i2c_read(1);
·· rangehigh = i2c_read(1);
·· rangelow· = i2c_read(0);
·· i2c_stop();
Comments
1: I haven't used the SRF08 personally.
2: Why would you want to reduce the range?
3: This is a Parallax PBasic forum, not a generic PIC CCS forum. Go ask them.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
I had solved my problem.·Thank you!