Code for connecting an RP2040 to a Bosch BNO055 IMU and having the realtime orientation data be sent to the host machine via serial USB

Overview

pico-bno055-rs

Have a Raspberry Pi Pico get its realtime orientation data from a Bosch BNO055 Inertial Measurement Unit and write the to the host computer via serial USB connection.

Get Started

  1. Install the latest version of Rust. This is the language in which this program is written.

  2. Install the thumbv6m-none-eabi target. This lets us compile our Rust program into a language understood by the Pico

rustup self update
rustup update stable
rustup target add thumbv6m-none-eabi
  1. Install the Rust port of ELF2UF2. This is used for flashing the program to the board
cargo install elf2uf2-rs
  1. Install Clippy. This is used to help lint the Rust code
rustup component add clippy
  1. Install just. This is used for running certain tasks, (just build will build the program, for example)
cargo install just
  1. Build the project to make sure everything's setup correctly
just build

And you're good to go! If you want to do some debugging as well, do the following optional steps.

  1. Install Python

  2. Install the pySerial library

Flashing the program to the Pico

To flash the program to the Pico:

  1. Plug in the Pico to your host machine in bootloader mode (with the on-board button held down)
  2. Run just flash

View Quaternion Data Live

  1. With the program flashed to the Pico, plug in the Pico via USB to the host computer
  2. Locate the serial port on the host computer (COM... on Windows, /dev/tty... on POSIX)
  3. Edit debug-quaternion.py to use the serial port to which the Pico is connected
  4. Run python scripts/debug-quaternion.py

Additional Resources

You might also like...
A stupidly simple and easy to self-host, personal server for file hosting on the web
A stupidly simple and easy to self-host, personal server for file hosting on the web

Grasswave CDN A stupidly simple and easy to self-host, personal server for file hosting on the web. Written in Rust. Thanks, @Maciejowski, for the sty

Hosts EDitor, it will add/update/delete host entries for you
Hosts EDitor, it will add/update/delete host entries for you

Host EDitor A command-line tool to easily manage you hosts file. View Demo · Report Bug · Request Feature Table of Contents About The Project Built Wi

Detect if code is running inside a virtual machine (x86 and x86-64 only).

inside-vm Detect if code is running inside a virtual machine. Only works on x86 and x86-64. How does it work Measure average cpu cycles when calling c

Membrane is an opinionated crate that generates a Dart package from a Rust library. Extremely fast performance with strict typing and zero copy returns over the FFI boundary via bincode.

Membrane is an opinionated crate that generates a Dart package from a Rust library. Extremely fast performance with strict typing and zero copy returns over the FFI boundary via bincode.

The axiom profiler for exploring and visualizing SMT solver quantifier instantiations (made via E-matching).

Axiom Profiler A tool for visualising, analysing and understanding quantifier instantiations made via E-matching in a run of an SMT solver (at present

Adapter plugin to use Ruff in dprint's CLI and with JavaScript via Wasm

dprint-plugin-ruff Adapter for Ruff for use as a formatting plugin in dprint. Formats .py and .pyi files. Note: For formatting .ipynb files, use the J

Code examples, data structures, and links from my book, Rust Atomics and Locks.

This repository contains the code examples, data structures, and links from Rust Atomics and Locks. The examples from chapters 1, 2, 3, and 8 can be f

notify Node.js binding via napi-rs.

@napi-rs/notify notify Node.js binding via napi-rs. Install this package yarn add

Trigger sounds via RFID tags or barcodes

Reads codes via RFID or 1D/2D barcode USB scanners and plays soundfiles mapped to them.

Owner
Gerald Nash
Gerald Nash
A cross-platform serial port library in Rust. Provides a blocking I/O interface and port enumeration including USB device information.

Note: This is a fork of the original serialport-rs project on GitLab. Please note there have been some changes to both the supported targets and which

Serialport 128 Jan 4, 2023
Create virtual serial ports, connect them to physical serial ports, and create routes between them all.

Virtual Serial Port Router (vsp-router) Create virtual serial ports, connect them to physical serial ports, and create routes between them all. vsp-ro

Rob Donnelly 3 Nov 24, 2022
A DIY, IMU-based skateboard activity tracker

tracksb A DIY, IMU-based skateboard activity tracker. The idea is to come up with algorithms to track activity during skateboarding sessions. A compan

null 21 May 5, 2022
RTIC monotonic implementation using the RP2040's Timer peripheral

rp2040-monotonic RTIC monotonic implementation using the RP2040's Timer peripheral. Documentation License Licensed under either of Apache License, Ver

Emil Fresk 6 Nov 24, 2022
μLA: Micro Logic Analyzer for RP2040

μLA: Micro Logic Analyzer SUMP/OLS compatible logic analyzer firmware for RP2040 based boards. Features 16 channels 100 MHz sampling rate, 1 sample pe

Vitaly Domnikov 197 Apr 19, 2023
Rust usb-device support for ATmega chips

atmega-usbd usb_device support for ATmega microcontrollers. NOTE: This is an experimental library, and certainly not production-ready. Expect bugs, an

Adam Gausmann 20 Jan 8, 2023
A cross-platform serial port library in Rust.

Introduction serialport-rs is a general-purpose cross-platform serial port library for Rust. It provides a blocking I/O interface and port enumeration

Bryant Mairs 143 Nov 5, 2021
🖥 Simple Arduino Serial Monitor

Born out of the desire to connect to an Arduino without having to run the whole Arduino suite.

Robin Schroer 2 Mar 19, 2022
Log defmt messages over the serial port.

defmt-serial A defmt target for logging over a serial port. Messages can e.g. be read using socat and passed through defmt-print, see example-artemis

Gaute Hope 10 Oct 5, 2022
Rust wrapping serial communication with ōRouter

orouter-serial (ōRouter serial protocol) This crate provides typed messages used for serial communication between host and oRouter. It also contains c

Overline Network 5 Dec 20, 2023