diff --git a/.gitmodules b/.gitmodules index d5831020..c8066dd4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -43,3 +43,6 @@ [submodule "docfx-tools"] path = docfx-tools url = https://github.com/bonsai-rx/docfx-tools.git +[submodule "src/device.hobgoblin"] + path = src/device.hobgoblin + url = https://github.com/harp-tech/device.hobgoblin diff --git a/images/device-hobgoblin-pico2.png b/images/device-hobgoblin-pico2.png new file mode 100644 index 00000000..68313813 Binary files /dev/null and b/images/device-hobgoblin-pico2.png differ diff --git a/src/device.hobgoblin b/src/device.hobgoblin new file mode 160000 index 00000000..54f666fd --- /dev/null +++ b/src/device.hobgoblin @@ -0,0 +1 @@ +Subproject commit 54f666fd7e75242ffe386b4c8c96a5ab4d5f875e diff --git a/tutorials/hobgoblin-setup.md b/tutorials/hobgoblin-setup.md new file mode 100644 index 00000000..a5b1a990 --- /dev/null +++ b/tutorials/hobgoblin-setup.md @@ -0,0 +1,48 @@ +# Getting Started + +The [Harp Hobgoblin](https://github.com/harp-tech/device.hobgoblin) is a simple multi-purpose device designed for learning the fundamentals of the Harp ecosystem. The principles demonstrated in this tutorial series can also be applied to other Harp devices. + +![Harp Hobgoblin Pico2](../images/device-hobgoblin-pico2.png){width=300} +*Pico2 board mounted on Gravity: Expansion Board* + +> [!NOTE] +> The `Hobgoblin` can be interfaced with a variety of input and output modules using the [Gravity: Expansion Board](https://www.dfrobot.com/product-2393.html). For more information on how to assemble the board, along with recommended sensor kits, refer to the resources in the [harp-tech/device.hobgoblin](https://github.com/harp-tech/device.hobgoblin) repository. + +## Installation + +- Install [Bonsai](https://bonsai-rx.org/docs/articles/installation.html). +- Install the `Harp.Hobgoblin` package by searching for it in the [Bonsai package manager](https://bonsai-rx.org/docs/articles/packages.html). + +## Flashing the firmware + +- Download the latest version of the [firmware](https://github.com/harp-tech/device.hobgoblin/releases/) that matches your Pico board. +- Press-and-hold the Pico `BOOTSEL` button while you connect the device to your computer's USB port. The Pico will be mounted as a new flash drive. +- Drag-and-drop the `.uf2` file into the drive. + +## Testing the device + +:::workflow +![Hobgoblin Hello World](~/workflows/hobgoblin-helloworld.bonsai) +::: + +- Connect a push button to analog input channel `0` (`GP26`) on the `Hobgoblin`. +- Set the `PortName` property of the [`Hobgoblin`](xref:Harp.Hobgoblin.Device) operator to the communications port of the `Hobgoblin` (e.g. COM7). +- Run the workflow and double-click the output of `AnalogInput0`. The value should change when the push button is pressed. + +## Installing harp-python + +The [harp-python](../articles/python.md) library provides a low-level interface to read and manipulate data from Harp devices. You can create a Python environment with `harp-python` using [`uv`](https://docs.astral.sh/uv/): + +- Install [`uv`](https://docs.astral.sh/uv/). +- Create a new folder for the project. +- Navigate to the folder and initialize a new environment: + +```cmd +uv venv +``` + +- Install `harp-python` as a dependency: + +```cmd +uv pip install harp-python +``` \ No newline at end of file diff --git a/tutorials/toc.yml b/tutorials/toc.yml new file mode 100644 index 00000000..95226829 --- /dev/null +++ b/tutorials/toc.yml @@ -0,0 +1,2 @@ +- name: Harp Hobgoblin +- href: hobgoblin-setup.md diff --git a/workflows/hobgoblin-helloworld.bonsai b/workflows/hobgoblin-helloworld.bonsai new file mode 100644 index 00000000..813c3cd8 --- /dev/null +++ b/workflows/hobgoblin-helloworld.bonsai @@ -0,0 +1,32 @@ + + + + + + + Active + On + true + On + Disabled + false + COM7 + + + + + + + AnalogInput0 + + + + + + + + \ No newline at end of file diff --git a/workflows/hobgoblin-helloworld.svg b/workflows/hobgoblin-helloworld.svg new file mode 100644 index 00000000..9751b8a1 --- /dev/null +++ b/workflows/hobgoblin-helloworld.svg @@ -0,0 +1,49 @@ + + +]> + + + + + + + + + + + + AnalogInput0 + + + + + Hobgoblin. + + + AnalogData + + + + + + + + Hobgoblin + + + + + + + + + + + + + + + + + \ No newline at end of file