Skip to content

Latest commit

 

History

History

agbgtc_tinyusb

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Seeeduino XIAO Mouse Controller

This variant was specifically developed for and tested on a Seeeduino XIAO microprocessor board.

It is currently dependent upon the Adafruit_TinyUSB library, but should be easy to adapt to any TinyUSB based environment in the future.

Setup and Build:

Abbreviated instructions for installing and setting up Arduino IDE v2.0.0-rc5 or greater for development.

  1. Install Arduino IDE v2.0.0-rc5 or greater (v1.8.x may also work but you will not see the src folder that contains the mouse helper utility class).
  2. Copy this agbgtc_tinyusb folder into your Arduino project folder.
  3. Open the agbgtc_tinyusb.ino file in the Arduino IDE. Notice that the src files must be retained in tact because there are relative references to it in the program.
  4. Add the Seeed Studio board package definitions using File ⮕ Preferences and adding the URL: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json
  5. Download the Seeeduino board drivers using Tools ⮕ Board Manager.
  6. Download the Adafruit_TinyUSB version 0.10.5 using Tools ⮕ Manage Libraries. You must select version 0.10.5 until Seeeduino releases an update (due to a breaking change in the 1.x release).

Convert Image Data

For your first run, you can skip this step and use the default example texture. This allows you to verify your initial setup before creating your own textures.

  1. Use the GBG_Texture_Builder utility to convert your image to a CSV representing the texture pixel data.
  2. Copy the CSV numbers into the image data array (images[][IMAGE_DATA_LEN]) in the program. If you're on a Mac the pbcopy utility is a quick way to copy the CSV data into your pasteboard (e.g., pbcopy < file.csv and then ⌘ Command + V to paste).
  3. Delete any example image data that you don't want.
  4. I've created over 28 images in one session without any problems. It's just limited by the amount of PROGMEM that is available on your board (and how long you want to wait).

Upload Program to Board

  1. Plugin the device to the computer.
  2. Select the Seeeduino XIAO Board and Port using the Tools menu.
  3. Select the TinyUSB Stack using Tools ⮕ USB Stack.
  4. Upload the program to the board.
  5. Unplug the XIAO board from the computer.

Running on Device

  1. Plug the Board into the Nintendo Switch USB-C port.
  2. Bring up a Game Builder Garage game and open programming mode.
  3. Trigger (or jump the start pin) to start creating the textures. By default this is pin 2. You can change this later or use a breadboard with a switch, etc. Be careful to only use 3.3V to jump the input pin signal because the inputs on this board can only tolerate 3.3V even though they provide a 5v converter pin as well.
  4. The light will stay solid while it's creating textures. Do not disturb the mouse or touch screen while it's working.
  5. Unplug when complete and the LED is alternating.

Useful References: