PicoHID Quick Start

A Unity 3D object ‘cube’ in the Demo scene tilts using the generated data of the Raspberry Pi Pico. The Raspberry Pi Pico generates 3D Object position data ‘x, y, z’ using the Trigonometric function. The Raspberry Pi Pico sends that data from the Raspberry Pi Pico to Unity through Windows PC using the USB HID (Human Interface Device) interface.
When clicking a Unity 3D object ‘Button’ in the Demo scene, Unity sends the numerical data obtained from the Unity 3D object ‘Inputfield’ to the Raspberry Pi Pico. Unity works at Windows PC and sends the numerical data to the Raspberry Pi Pico using the USB HID (Human Interface Device) interface.
The following shows the capture screen when the Demo scene runs.

This Quick Start explains how to display the Demo scene on Unity using PicoHID. This Quick Start also includes some steps for downloading and setting up a package in Unity Project, and writing the Raspberry Pi Pico code.

Step-1 Download and set up a package in Unity Project
Step-2 Write Raspberry Pi Pico code using Arduino IDE
Step-3 Run Demo scene

Step-1 Download and set up a package in Unity Project

  1. Download PicoHID from the Asset Store, and click on the Import button.
  2. The package is imported under the Assets folder in your Unity project.
  3. Download the external plugin ’PicoHIDConnect-v2’ below and set it into the ‘Assets/PicoHIDInterface’ folder.
  4. Click the Project tab, choose ‘Assets’ > ‘PicoHIDInterface’ > ‘Scenes’ folder of the left side menu, double click on the Demo scene ‘PicoHIDSampleScene’ in the Project window.
  5. Step-2 Write Raspberry Pi Pico code using Arduino IDE

    1. Connect the Raspberry Pi Pico by Micro USB cable to Windows PC, then build a software development environment for PicoHID with the Arduino IDE according to Arduino IDE for PicoHID.
    2. Compile and write Raspberry Pi Pico code ‘picohid-v2.ino’ of the folder ‘/Assets / PicoHIDInterface/picohid-v2’ into the Raspberry Pi Pico using the Arduino IDE.

    Step-3 Run Demo scene

    1. In Windows PC, go to ‘Start’, choose ‘Settings’ > ‘Devices’ > ‘Bluetooth and other devices settings’. Click ‘Add Bluetooth or other device’ to start searching for the device.
    2. Like below, select the Bluetooth device ‘Pico’ you want to add from the list.
    3. Click the ‘Play’ button on Unity. The Unity 3D object ‘cube’ tilts in sync with the received data from the Raspberry Pi Pico. The ‘x, y, z’ in the ‘PicoHIDSampleCode’ of the ‘Inspector’ tab displays the received data ‘x, y, z’ from the Raspberry Pi Pico as follows.
    4. The ’console’ tab displays the game status as follows.
    5. The ‘Serial Monitor’ of Arduino IDE displays the data “x, y, z” as follows.
    6. Set No0 / No1 into Inputfield ’No0’ / Inputfield ‘No1’ in the game screen, then click the Button ‘On’ to send to the Raspberry Pi Pico. Show Inputfield ’No0’ / Inputfield ‘No1’ as follows.
    7. The ’console’ tab displays the game status at clicking Button ‘On’ as follows.
    8. The ‘Serial Monitor’ in Arduino IDE displays the No0/No1 data as follows.