Tuesday, December 12, 2006

Programming i-Box III

video
iBox III Programmed to Never Fall From Table and Stay Away From Walls...

All you need is

2x IR Reflectors
1x Distance Sensor
2x DC Motors1x iBox III Microcontroller

This is very simple program following commands will do this all.


start
to alert
beep
end

to start
wait 100
ab, setpower 8

loop [ if (( sensor 0) > 300
and ((sensor 1) > 300 ))
[ ab, thisway ab, on ]

if ((sensor 2) > 300)
[alert
ab, thatway ab, onfor 150
a, thisway a, onfor 50
a, thatway
ab, on]


if ((sensor 0) <>
[alert
ab, thatway ab, onfor 150
a, thisway a, onfor 50
a, thatway
ab, on]

if ((sensor 1) <>
[alert
ab, thatway ab, onfor 150
b, thisway b, onfor 50
b, thatway
ab, on] ]


if ((sensor 3) > 850)
[alert
ab, thatway ab, onfor 150
a, thisway a, onfor 50
a, thatway
ab, on]
]

end
Please note this programme will handle both 1)Never fall from table 2) Never collide with Walls.
You can add further funcaitonlity in this program for example add a light sensor and then you can program to start moving is light is on and stop when light is off, things like this.