Hi recently purchased an Ir Seeker and IR ball However I am in the middle of project using the ball and IrSeeker for a school project, but i can't figure out how to to get the approximate distance from the ball using the address specified for the IRSeeker using robotC to program . Please any example code or help would be gladly appreciated.
Each address stores a signal, these are:
0x43, 0x44, 0x45, 0x46, 0x47.

Mon Feb 25, 2008 6:01 pm

Dick Swan

Creator

Joined: Fri Feb 09, 2007 9:21 amPosts: 616

If you want someone to respond then you need to provide more information. Whose product is the "IR Seeker" and which "IR Ball". I'm assuming these are for Robocup Jr competition but don't really know. It would be good if you included web hyperlink to product datasheets and then someone might look up and provide you insight.

Wed Feb 27, 2008 10:40 am

Redz

Rookie

Joined: Wed May 30, 2007 4:33 amPosts: 2Location: Wooster, OH

I'm Sorry. I'm not using it for Robocup Jr. But as a beacon for the robot to find it goal location while traversing a room autonomously and so the nxt will need to know how close it is to the ball to terminate and return that it found the ball. I am using both the hitechnic IRSeeker and IRball.
The link for the info on the IRSeeker can be found here:
http://www.hitechnic.com/index.html?lan ... t=d23.htmland the ball :
http://www.hitechnic.com/

Wed Feb 27, 2008 11:13 am

Dick Swan

Creator

Joined: Fri Feb 09, 2007 9:21 amPosts: 616

Do you have a program that will read the six sensor values from the IR sensor. This is simply an I2C read program of six consecutive bytes and can be adapted from any of several samples found in the ROBOTC distribution.

You'll probably want a background task that is periodically polling the IR Sensor on a 10 to 20 millisecond basis.

ONce you've got the six sensor values then you need to figure out which is the "brightest" (i.e. has the highest value -- presumably high values and not low values indicate bright).

There are five sensors. If one is highest value then "direction" is 1, 3, 5, 7, 9 corresponding to the appropriate sensor. If two sensors have the same value then direction is the in-between values of 2, 4, 6, 8.

Hope this helps. Let me know how you make out.

You should learn how to use the ROBOTC "I2C Test" screen. You'll find it very useful in figuring out all of above. You can set it up to continuously poll the IR Seeker and display the six sensor values on a PC screen with rapid update.

Wed Feb 27, 2008 11:26 am

orangecanary

Rookie

Joined: Wed May 07, 2008 7:07 amPosts: 3

Re: IRSeeker distance approxiamation

I'm also having problems with the HiTechnic IRSeeker. I have run tests with the I2C Test screen and sent it a message to get back type, manufacturer and version which works without issue.

I have also tried the following messages:

"02 42" which are meant to bring back the direction and "02 43 44 45 46 47" to bring back the 5 bytes for the signal strength.

I am getting readings from the first 3 bytes but do not get values in the last 3 bytes.

I am using v1.10. Is this an issue with the sensor or RobotC or Me?

I also see a similar issue when retrieving the values programmatically through the I2C calls.

#define MsgSize 6 // The length of the message you want the NXT to write to the i2c bus
#define DeviceAddress 0x02 // The i2c address of the sensor. With NXT it is usually 0x02
#define DataLocationPtr 0x42 // The address of the Register to start reading from
#define sensorPort S1 // Port the sensor is connected to on the NXT

The I2C Test screen is different to that in the help. There is no I2C Custom selection in the menu for sensor type, no Trace All Activity checkbox, etc.

I chosen Digital In as the type and set up the messages just to get version "02 00", Manufacturer "02 08" and Type "02 10". All bringing back 8 bytes. I have the NXT turned on an no program running. I get "Not configured as I2C" in the each reply field.

If I download the program above and set it running I do get results back in the I2C Test screen but I also semi regularly get a reply in one of the reply fields that reads "I2C Read Timed Out".

The program above still produces output the same as with version 1.10 with only partial results.

Mon May 12, 2008 6:58 am

orangecanary

Rookie

Joined: Wed May 07, 2008 7:07 amPosts: 3

Re: IRSeeker distance approxiamation

Is there any update on this issue with the HiTechnic IC2 sensors and RobotC 1.10 and 1.30.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum