# How to Use Joysticks to Control a Robot
![This #How to shows you how to use joysticks to control programmable robots like mBot, Codey Rocky, and Ranger.](https://cdn.shopify.com/s/files/1/0070/5901/3716/files/11111_48ef8e74-3964-4cd4-98cb-a40ddfd80da3.png?v=1687166025)
Take the popular game "The Legend of Zelda: Breath of the Wild" as an example. Players use two joysticks to control the protagonist Link. Actions such as movements and camera control are accomplished with the joysticks. Have you ever wondered why game developers set these actions to be done with joysticks instead of buttons? What is the difference between programming joysticks and programming buttons?
![Switch](https://cdn.shopify.com/s/files/1/0070/5901/3716/files/20230619175121_rec_-convert.gif?v=1687168378)
![control mBot with a joystick](https://cdn.shopify.com/s/files/1/0070/5901/3716/files/x.gif?v=1687329044)
![joystick](https://cdn.shopify.com/s/files/1/0070/5901/3716/files/1_308b128c-8efd-43da-8f0a-1db728e86afa.png?v=1687166659)
In comparison to a button, a joystick can output command signals for movements that are not limited to a single direction. With a joystick, you can control the movement direction and speed.
Let's start!
# Coding Time #
![Scratch tutorials for mBot](https://cdn.shopify.com/s/files/1/0070/5901/3716/files/2_ed6d269b-d383-4b29-9dde-c59c4cd24306.png?v=1687167296)