The 4Tronix PiBug is a Raspberry Pi based robot vehicle, powered by a 6 x AA cells (NiMH recommended but long-life Alkalines can be used instead)

The basic model can be enhanced with IR line sensors  and also an ultrasonic sensor can be added

It is supported by both ScratchGPIO (Scratch 1.4 based) and S3GPIO (Scratch 3 based)


To control PiBug, create a variable called AddOn and set it to PiBug.

Then create variables MotorL and MotorR.  You can set these to values from -100 (full reverse speed) to 100 (ful forward speed)

There are 4 sensor values available:

Ultra is the distance measured using the option ultrasonic sensor (up to 299 cm)

The two optional line followers return on if they detect a bright, reflective surface

The switch on the right-side can be very useful if programmed to stop the motors when pressed on