Joystick Mouse

Create your own mouse!

alt text

Beginner circuitpython project to understand the basics of programming and create human interface devices.

In this project you will:

Hardware

Images

Wiring Diagram

alt text

Code

  1. libraries are imported for interfacing with other programs.
  2. A library is simply more code. It is a way to hide code inside other code and allows common functions to be re-used
  3. Pins and hardware are initialized
  4. A button (Switch) is set up to listen for when the user presses the joystick
  5. 2x analog input pins are set up to read a value. Rather than 0 or 1 for on off, this can read values in between. Like .2 or .7!
  6. Loop
  7. This is a fundamental concept in programming. It simply means when the logic is finished, it starts again. Creating a full circle, or loop.
  8. Reads button. If the button is pressed, it sends a mouse click event, otherwise it is released.
  9. Reads analog values. If the values are negative or positive, it will move the mouse that many pixels

  10. github