Studio 3

Tuesday, April 04, 2006

Week 6 - Sudden Idea

Ok, I've just got this sudden idea and I know myself too well that if I don't blog or weite down I'll forget it the minute I get home.

Just finished my skills session, and there was this device called the "close sensor", basically it detects the distance, how far objects are away from it and all, basically speaks fo itself.

The "close sensor"(being linked up with the EZIO device) will return a value to director between 1 to 256, 1 being very close and 256 being the maximum distance. Thus the rough coding just poped up in my head. If we could connect this EZIO device to something like a small car and have its on/off switch connected/controlled by the EZIO, the code would look something like this

on exitframe me

close sensor declared as "a/n 1"

-- "0" being on and "1" being off
car control declared as "a/n 2"

if ( "a/n 1" > 229) then
"a/n 2" = 0
--setting "a/n 2" to 0 switching the car on to start moving
else if ("a/n 1" < 230) then
"a/n 2" = 1
-- setting "a/n 2" to 1 switching it off and thus stopping it
end if

end

This would be a rough coding to make the car follow you in a straight line and to stop at a certain distance, how this distance is highly dependent on the sensitivity of the "close sensor".
There is a limit to this though, in fact the question would be "What if I walked round a corner?", is there any other method of coding this, or a sensor that detects non-linear movement?

0 Comments:

Post a Comment

<< Home