Wirelessly Controlled Quadruped

Example Description
In this tutorial, you will learn how to control a quadruped robot using arrow keys.


In this example, we will make the computer program that controls a “quadruped” (a four-legged robot). It’s like a remote control car, except with four legs instead of four wheels. You can press different keys on the keyboard to make the quadruped move forward, backward, turn left and turn right.


The Quadruped will move according to the following logic:

  1. Quadruped will move forward When the “UP” key is pressed.
  2. Quadruped will move backward When the “DOWN” key is pressed.
  3. Quadruped will turn left When the “LEFT” key is pressed.
  4. When the “RIGHT” key is pressed – Quadruped will turn right.


The program uses the up, down, left, and right arrows to control the robot and make it move forward, backward, left, and right. Every time you press one of the arrows, Quadruped will move in the direction you choose for specific steps.

sprite = Sprite('Tobi')
quarky = Quarky()
import time


while True:
  if sprite.iskeypressed("up arrow"):
  if sprite.iskeypressed("down arrow"):
  if sprite.iskeypressed("left arrow"):
    quad.move("turn left",1000,1)
  if sprite.iskeypressed("right arrow"):
    quad.move("turn right",1000,1)


Table of Contents