![]() |
Need a bit of help with the Sonar
Our model number is MB1222, we're unsure how to wire it and schemeatics aren't really helping. We'd like help so that we can use for the FIRST Robotics Competion. We've hooked up positive and negative, now we're kind of stuck. Specificaly, we don't know how to hook up the signal wire. Thanks.
-Team 4641 :confused: |
Re: Need a bit of help with the Sonar
You've chosen a part that requires more programming support than most. http://www.maxbotix.com/Ultrasonic_Sensors/MB1222.htm says that it connects via the I2C interface. In addition to power and ground, you'll need to wire the SDA (data) and SCL (clock) pins. What language are you using to write your robot program?
|
Re: Need a bit of help with the Sonar
Heres some arduino code we used. We altered it greatly but it shoudl get you started.
Code:
/* This script is designed to take several readings from the maxbotix sonar and generate a mode/median. |
Re: Need a bit of help with the Sonar
Quote:
|
Re: Need a bit of help with the Sonar
Quote:
Why did you pick the MB1222 device? I2C is powerful, but it's one of the more complex schemes available in the MaxBotics sensor line. If you feel up to the challenge, you can use the ADXL345 I2C Accelerometer example as a starting point. It shows how to communicate with an I2C device. The MB1222 datasheet tells what the 8-bit equivalent read and write addresses are (E0 and E1), and describes how to interpret the response. If you aren't comfortable blazing new trails, you would find your job to be much easier if you used something like the MB1010 or MB1020 instead. Reading its output can be as simple as reading an analog voltage, something which is well supported by the FRC programming tools. |
| All times are GMT -5. The time now is 05:28. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi