Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
non-destructive text micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
badge fixer
non-destructive text micropython
Commits
57c92d90
Commit
57c92d90
authored
Aug 27, 2016
by
Philip Potter
Committed by
Damien George
Aug 29, 2016
Browse files
Options
Downloads
Patches
Plain Diff
docs/pyboard: Update USB mouse tutorial to use VCP instead of CDC.
parent
13c5a228
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/pyboard/tutorial/usb_mouse.rst
+9
-9
9 additions, 9 deletions
docs/pyboard/tutorial/usb_mouse.rst
with
9 additions
and
9 deletions
docs/pyboard/tutorial/usb_mouse.rst
+
9
−
9
View file @
57c92d90
...
@@ -13,23 +13,23 @@ will look something like this::
...
@@ -13,23 +13,23 @@ will look something like this::
import pyb
import pyb
#pyb.main('main.py') # main script to run after this one
#pyb.main('main.py') # main script to run after this one
#pyb.usb_mode('
CDC
+MSC') # act as a serial and a storage device
#pyb.usb_mode('
VCP
+MSC') # act as a serial and a storage device
#pyb.usb_mode('
CDC
+HID') # act as a serial device and a mouse
#pyb.usb_mode('
VCP
+HID') # act as a serial device and a mouse
To enable the mouse mode, uncomment the last line of the file, to
To enable the mouse mode, uncomment the last line of the file, to
make it look like::
make it look like::
pyb.usb_mode('
CDC
+HID') # act as a serial device and a mouse
pyb.usb_mode('
VCP
+HID') # act as a serial device and a mouse
If you already changed your ``boot.py`` file, then the minimum code it
If you already changed your ``boot.py`` file, then the minimum code it
needs to work is::
needs to work is::
import pyb
import pyb
pyb.usb_mode('
CDC
+HID')
pyb.usb_mode('
VCP
+HID')
This tells the pyboard to configure itself as a
CDC (serial) and HID
This tells the pyboard to configure itself as a
VCP (Virtual COM Port,
(human interface device, in our case a mouse)
USB device when it boots
ie serial port) and HID
(human interface device, in our case a mouse)
up.
USB device when it boots
up.
Eject/unmount the pyboard drive and reset it using the RST switch.
Eject/unmount the pyboard drive and reset it using the RST switch.
Your PC should now detect the pyboard as a mouse!
Your PC should now detect the pyboard as a mouse!
...
@@ -121,9 +121,9 @@ If you leave your pyboard as-is, it'll behave as a mouse everytime you plug
...
@@ -121,9 +121,9 @@ If you leave your pyboard as-is, it'll behave as a mouse everytime you plug
it in. You probably want to change it back to normal. To do this you need
it in. You probably want to change it back to normal. To do this you need
to first enter safe mode (see above), and then edit the ``boot.py`` file.
to first enter safe mode (see above), and then edit the ``boot.py`` file.
In the ``boot.py`` file, comment out (put a # in front of) the line with the
In the ``boot.py`` file, comment out (put a # in front of) the line with the
``
CDC
+HID`` setting, so it looks like::
``
VCP
+HID`` setting, so it looks like::
#pyb.usb_mode('
CDC
+HID') # act as a serial device and a mouse
#pyb.usb_mode('
VCP
+HID') # act as a serial device and a mouse
Save your file, eject/unmount the drive, and reset the pyboard. It is now
Save your file, eject/unmount the drive, and reset the pyboard. It is now
back to normal operating mode.
back to normal operating mode.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment