Subject:
|
Re: anyone deal with techno-stuff's DIRPD sensor?
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Mon, 10 Mar 2003 16:21:18 GMT
|
Viewed:
|
796 times
|
| |
| |
I added support for these to BrickOS some time back, so if you are using
BrickOS take a look at dirpd.h. If you are not using BrickOS still take a look
dirpd.h it will show you how to decode the values. It is fairly trivial, and
the dirpd.h file just tries to make it easier.
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/brickos/brickos/include/dirpd.h?rev=HEAD&content-type=text/vnd.viewcvs-markup
to use it just do something along the lines of
//activate SENSOR_1
if(DIRPD_LEFT(SENSOR_1)) {
//object on left
//turn right
} else if(DIRPD_RIGHT(SENSOR_1)) {
//object on right
//turn left
} else if(DIRPD_CENTER(SENSOR_1)) {
//object in front
//backup
} else if(DIRPD_NONE(SENSOR_1)) {
//no object
//go forward
} else {
//error
}
mark
|
|
Message has 1 Reply: | | Re: anyone deal with techno-stuff's DIRPD sensor?
|
| Thanks Mark, Im going to try it now, and i had your files i got it from the guy at techno-stuff and from the api, but it may be trival but i was not really understanding it. I ended writing you an email today asking about it (i havent yet looked at (...) (22 years ago, 17-Mar-03, to lugnet.robotics)
|
Message is in Reply To:
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|