Lesson 7: CPX as a Mouse

Table of Contents

  1. Lesson 7.1: Making a Programmable Mouse
    1. Lesson 7.1 Code
  2. Lesson 7.2: Accelerometer Mouse
    1. Lesson 7.2 Code
  3. Project Examples
  4. Next Lesson

In Lesson 7 of our CPX series, we will learn how to use the CPX as a programmable mouse. We’ll begin by making a discrete mouse that shifts the mouse cursor by small amounts with button A and B presses before building a more complex accelerometer-based mouse with continuous input.

Lesson 7.1: Making a Programmable Mouse

In this lesson, we will show how to use the CPX as a programmable mouse.

Lesson 7.1 Code

Lesson 7.2: Accelerometer Mouse

In this lesson, we will show how to use the CPX’s built-in accelerometer to make smooth, continuous mouse input.

Lesson 7.2 Code

Project Examples

All project examples below provide tutorials with example MakeCode code.

Next Lesson

In the next lesson, we’ll learn how to hook up external sensors like potentiometers using analog input on the CPX.

Previous: CPX as a Keyboard Next: Analog Input on the CPX


This website was developed by Professor Jon E. Froehlich and the Makeability Lab using Just the Docs. If you found the website useful or use it in your teaching, we'd love to hear from you: jonf@cs.uw.edu. This website and all code is open source (website GitHub, Arduino GitHub, p5js GitHub). You can find the MakeabilityLab_Arduino_Library here. Found an error? File a GitHub Issue.