I built this robot a while back, but I can’t stand the software that comes with the NXT, my own compiler isn’t ready yet, and any other remote controls I found didn’t work particularly well, if at all.

If you want it done right, you have to do it yourself – Bernd Paysan

So I threw together PyGame and nxt-python, and wrote my own little application to control the NXT. Notice that it looks very similar to this PyMouse code

I have no building plans for the robot, it’s the standard wheel base with my own pincer. I do have the code:

importpygamefromnxtimportlocator,motorfromtimeimportsleep# edit this to reflect your joystick axis and buttonsaxis={'x':0,'y':1,'x*':3,'y*':5}b=locator.find_one_brick()left=motor.Motor(b,motor.PORT_B)right=motor.Motor(b,motor.PORT_A)action=motor.Motor(b,motor.PORT_C)closed=Falsedeflimit(nr):ifnr>50ornr<-50:returnmin(127,max(-128,nr))else:return0defmove(fwd=0,turn=0):lp=int((fwd-turn)*-100)rp=int((fwd+turn)*-100)left.run(limit(lp))right.run(limit(rp))defpincer(button):globalclosedtry:ifbuttonandnotclosed:closed=Trueaction.turn(-40,70,emulate=False)elifnotbuttonandclosed:closed=Falseaction.turn(30,70,emulate=False,brake=False)exceptmotor.BlockedException:printaction.get_tacho()pygame.init()j=pygame.joystick.Joystick(0)# first joystickj.init()print'Initialized Joystick : %s'%j.get_name()try:whileTrue:pygame.event.pump()sleep(0.1)# get_axis returns a value between -1 and 1move(j.get_axis(axis['y']),j.get_axis(axis['x']))pincer(j.get_button(0))exceptKeyboardInterrupt:j.quit()