HOME
NXT creations
RCX CREATIONS
BOOKS & PAPERS
SHOP
SOFTWARE
LINKS
ABOUT ME
SUBSCRIBE TO RSS FEEDS!

LIKE THIS PAGE ON FACEBOOK!

NXTAPOD

This simple hexapod robot can walk and reverse-turn using just one motor. It can detect obstacles using the ultrasonic sensor.

 

The programming is really simple: the robot steps forward until the Ultrasonic Sensor measures detects a nearby object, then it reverse the motor direction and a clever escapement mechanism allows the backward-turn maneuvre, driving just one row of legs.

Here's the latch mechanism that does the trick:

Connect an ultrasonic sensor to input port 4,

and the motor to output port A. The minimal NXC code is as simple as:

task main ()
{
   SetSensorLowspeed(IN_4);
   while (true)
   {
      OnFwd(OUT_A,100);
      Wait(1000);
      while (SensorUS(IN_4)>20);
      OnRev(OUT_A,100);
      Wait(2000);
      while (SensorUS(IN_4)<40);
   }
}
 

Download building instructions

Click on the box to get the NXT 2.0 retail set!
Daniele Benedettelli, November 2009

Daniele

Benedettelli

07-05-12

This page is not connected with or endorsed by The LEGO Company.

LEGO, LEGO SYSTEM, LEGO TECHNIC, and LEGO MINDSTORMS are trademarks of The LEGO Company.