Skip to content
Snippets Groups Projects
Commit afd10a45 authored by Vicki Lowe's avatar Vicki Lowe Committed by Damien George
Browse files

docs/pyboard: Emphasize the instructions for making a USB mouse.

It wasn't clear why that element was `10` instead of `0`.  Also bumped the
`10` to `100` to make the mouse movement more obvious.
parent d5a77416
No related branches found
No related tags found
No related merge requests found
......@@ -39,14 +39,15 @@ Sending mouse events by hand
To get the py-mouse to do anything we need to send mouse events to the PC.
We will first do this manually using the REPL prompt. Connect to your
pyboard using your serial program and type the following::
pyboard using your serial program and type the following (no need to type
the ``#`` and text following it)::
>>> hid = pyb.USB_HID()
>>> hid.send((0, 10, 0, 0))
>>> hid.send((0, 100, 0, 0)) # (button status, x-direction, y-direction, scroll)
Your mouse should move 10 pixels to the right! In the command above you
are sending 4 pieces of information: button status, x, y and scroll. The
number 10 is telling the PC that the mouse moved 10 pixels in the x direction.
Your mouse should move 100 pixels to the right! In the command above you
are sending 4 pieces of information: **button status**, **x-direction**, **y-direction**, and **scroll**. The
number 100 is telling the PC that the mouse moved 100 pixels in the x direction.
Let's make the mouse oscillate left and right::
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment