ROBOTC.net forums
http://www.robotc.net/forums/

How to use the HTDIRreadACStrength
http://www.robotc.net/forums/viewtopic.php?f=41&t=3466
Page 1 of 1

Author:  Sambo [ Wed Sep 14, 2011 8:38 am ]
Post subject:  How to use the HTDIRreadACStrength

Hey, I'm currently stuck on a part of my program involving the HTDIRreadACStrength. The program is for robosoccer, specifically a goaly. What it is meant to do is stay in a black square, until the IR ball comes close enough (hence the use of the HTDIRreadACStrength) that it charges at it, and dribbles it towards the opponent's goals.

Everything else in my program works besides the ball strength, which only gives a value when the ball is 5 (in HTDIRreadACDir terms). Im looking mainly for some tutorial of how to use the HTDIRreadACStrength, whether i should be using the HTDIRreadACStrength or HTDIRreadAllACStrength and if there may be another way. I can post part of the code if needed.

Thanks,
Sambo

Author:  mightor [ Wed Sep 14, 2011 8:45 am ]
Post subject:  Re: How to use the HTDIRreadACStrength

There is no tutorial apart from the examples that come with the driver suite. Did you take a look at those?

- Xander

Author:  Sambo [ Wed Sep 14, 2011 9:23 am ]
Post subject:  Re: How to use the HTDIRreadACStrength

mightor wrote:
There is no tutorial apart from the examples that come with the driver suite. Did you take a look at those?

- Xander


I've had a look over some of them, but i cant seem to find one that would specifically help me in this case, altho I might be completely wrong. Can you think of one of the examples that would help me put me on track for this?

sambo

Author:  mightor [ Wed Sep 14, 2011 9:30 am ]
Post subject:  Re: How to use the HTDIRreadACStrength

In HTIRS2-test1.c there's a call to HTIRS2readAllACStrength() that fetches all the different sensor values. Is this not what you have been using?

Are you using the 2.1 version of the driver suite?

- Xander

Author:  Sambo [ Wed Sep 14, 2011 9:49 am ]
Post subject:  Re: How to use the HTDIRreadACStrength

I'm using the 2.1 version. Before we were actually using another driver, not sure what version, but HTDIR-driver, not HTIRS2-driver

Author:  mightor [ Wed Sep 14, 2011 9:58 am ]
Post subject:  Re: How to use the HTDIRreadACStrength

Do you have a HT IR Seeker V1 or V2? :) Does it look like this one: http://www.hitechnic.com/cgi-bin/commer ... ey=NSK1042 ?

- Xander

Author:  Sambo [ Wed Sep 14, 2011 9:59 am ]
Post subject:  Re: How to use the HTDIRreadACStrength

Yes its a V2 one.

Author:  mightor [ Wed Sep 14, 2011 10:03 am ]
Post subject:  Re: How to use the HTDIRreadACStrength

The HTDIR driver isn't the right driver to use then :) It should be HTIRS2-driver.h

- Xander

Author:  Sambo [ Wed Sep 14, 2011 10:15 am ]
Post subject:  Re: How to use the HTDIRreadACStrength

Ok i've changed all that over now, the reason we were just using the HTDIR-driver was because of just needing to know the ball direction. How can i make it so that no matter where the ball is around the sensor it will give me a strength value?

Author:  mightor [ Wed Sep 14, 2011 1:33 pm ]
Post subject:  Re: How to use the HTDIRreadACStrength

I am not sure I understand what you mean. You will never see a strength value if the sensor cannot see the ball. You don't just get 1 strength value, you get 5 of them. Are you looking for some kind of way to get a feeling of how far the ball is general? If that's the case then I have to disappoint you, there is no HTIRS2readDCAverage() equivalent for the AC signals. You may need to do some additional maths yourself.

- Xander

Author:  Sambo [ Wed Sep 14, 2011 7:46 pm ]
Post subject:  Re: How to use the HTDIRreadACStrength

Sorry, I meant that as long as the ball is in the sensors range (between 1-9) that it could give the strength value instead of just at 5. It seems I might just have to change how the goaly operates if there is no equivalent for the AcStrength. Thanks for the help.
Sambo

Author:  mightor [ Thu Sep 15, 2011 1:58 am ]
Post subject:  Re: How to use the HTDIRreadACStrength

Do you also see this problem of just a signal when the ball is at 5 when you're using one of my test programs?

- Xander

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/