i came up with this idea when i watched a program where a car was programmed to detect obstacles and prevent collision. this does pretty much the same. the system consists of 8 rotating white dots, 6 in an inner circle around the ''car'', and two circling around at a longer distance. when one dot senses the edge, it changes the variable ''distance'' to the direction minus 180. the ''car'' moves one step, then turns to the ''variable direction'' thus preventing a collision with the edge.