Arduino Uno 9 axis acceleration sensor (BMX055) reader implemented in Rust.

Overview

Arduino Uno Accelaration reader in Rust

Components

  • Arduino Uno (Probably possible with other AVR microcontrollers)
  • BMX055 (Japanese website)

Datasheet

Environment

  • Windows 11
  • rustc 1.68.0-nightly (37d7de337 2022-12-12)
  • cargo 1.68.0-nightly (70898e522 2022-12-05)
  • ravedude v0.1.5 (no git)

Setup

Hardware

Arduino Uno BMX055
5V VCC
GND GND
A4 SDA
A5 SCL

Software

cargo install ravedude

For details to avr-hal repository in GitHub.

Usage

cargo run --release

Output Examples

Start initializing
Finish sensor initializing
Start loop
ACCL -> X: 0.24412, Y: 0.11718, Z: 9.81382
GYRO -> X: 0.01304, Y: 0.00759, Z: 0.02083
ACCL -> X: 0.23436, Y: 0.11718, Z: 9.81382
GYRO -> X: 0.00146, Y: 0.00885, Z: 0.00139

Future outlook

  • Use magnetic sensors
  • Implement Madgwick filter
  • Sensor fusion for posture estimation
You might also like...
Keyboard firmware implemented in Rust

flutterby-rs Keyboard firmware implemented in Rust. It doesn't do anything useful yet! Building for atmega32u4 devices (ergodox-ez, feather32u4) First

A zsh histb browser using skim. Implemented in rust.

A zsh histb browser using skim. Implemented in rust.

The Roguelike Toolkit (RLTK), implemented for Rust.

The Roguelike Toolkit (RLTK), implemented for Rust.

Nix binary cache implemented in rust using libnix-store

harmonia Build Whole application nix-shell --run cargo b C Library Wrapper around libnixstore nix-shell --run make Note: The makefile is only to pro

This is a Pomodoro Clock implemented as a Zellij plugin.

Pomodoro Clock This is a Pomodoro Clock implemented as a Zellij plugin. It shows a Pomodoro time as well as current date time. Prerequisite You must i

An ND812 decoder implemented as part of the yaxpeax project

yaxpeax-nd812 an ND812 decoder implemented as part of the yaxpeax project, including traits provided by yaxpeax-arch. the ND812 is a 12-bit microcompu

k-mer counter in Rust using the rust-bio and rayon crates

krust is a k-mer counter written in Rust and run from the command line that will output canonical k-mers and their frequency across the records in a f

Experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code

Diplomat is an experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code. With Diplomat, you can simply define Rust APIs to be exposed over FFI and get high-level C, C++, and JavaScript bindings automatically!

Aws-sdk-rust - AWS SDK for the Rust Programming Language

The AWS SDK for Rust This repo contains the new AWS SDK for Rust (the SDK) and its public roadmap. Please Note: The SDK is currently released as a dev

Comments
  • `serde_json_core`を用いてjsonにしようとするとビルドエラーが起きる。

    `serde_json_core`を用いてjsonにしようとするとビルドエラーが起きる。

    Environment

    • rustc 1.68.0-nightly (bdb07a8ec 2022-12-11)
    • rustup 1.25.1 (bb60b1e89 2022-07-12)
    • cargo 1.68.0-nightly (70898e522 2022-12-05)

    影響がありそうな箇所。

    https://github.com/kaaatsu32329/accelduino-rs/blob/8cb85d3b7daabe105f4339f413210f7a9f536dc0/src/main.rs#L44-L47

    コンパイラーオプション周りかもしれない。

    出力

    > cargo build
       Compiling accelduino-rs v0.1.0 (C:\Users\user\Documents\accelduino-rs)
    error: linking with `avr-gcc` failed: exit code: 1
      |
      = note: "avr-gcc" "-mmcu=atmega328p" "-Wl,--as-needed" "C:\\Users\\user\\AppData\\Local\\Temp\\rustcrgXaxG\\symbols.o" "C:\\Users\\user\\Documents\\accelduino-rs\\target\\avr-atmega328p\\debug\\deps\\accelduino_rs-94636f02bf0d8abe.serde_json_core-1eead99fff5793d7.serde_json_core.177c91ea-cgu.0.rcgu.o.rcgu.o" "-Wl,--as-needed" "-L" "C:\\Users\\user\\Documents\\accelduino-rs\\target\\avr-atmega328p\\debug\\deps" "-L" "C:\\Users\\user\\Documents\\accelduino-rs\\target\\debug\\deps" "-L" "C:\\Users\\user\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\avr-atmega328p\\lib" "-Wl,-Bstatic" "C:\\Users\\user\\Documents\\accelduino-rs\\target\\avr-atmega328p\\debug\\deps\\libcompiler_builtins-1aa59d2479cb0a07.rlib" "-Wl,-Bdynamic" "-lgcc" "-Wl,-znoexecstack" "-L" "C:\\Users\\user\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\avr-atmega328p\\lib" "-o" "C:\\Users\\user\\Documents\\accelduino-rs\\target\\avr-atmega328p\\debug\\deps\\accelduino_rs-94636f02bf0d8abe.elf" "-Wl,--gc-sections" "-no-pie"
      = note: c:/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: address 0x8034bc of C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\accelduino_rs-94636f02bf0d8abe.elf section `.data' is not within region `data'
              c:/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\accelduino_rs-94636f02bf0d8abe.elf section `.data' will not fit in region `text'
              c:/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: address 0x8034bd of C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\accelduino_rs-94636f02bf0d8abe.elf section `.bss' is not within region `data'
              c:/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: address 0x8034bc of C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\accelduino_rs-94636f02bf0d8abe.elf section `.data' is not within region `data'
              c:/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: address 0x8034bd of C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\accelduino_rs-94636f02bf0d8abe.elf section `.bss' is not within region `data'
              c:/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: region `text' overflowed by 8096 bytes
              C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\libcompiler_builtins-1aa59d2479cb0a07.rlib(compiler_builtins-1aa59d2479cb0a07.compiler_builtins.e959a4ad-cgu.15.rcgu.o): In function `<f64 as compiler_builtins::float::Float>::normalize':
              C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.85/src\float/mod.rs:164: undefined reference to `core::panicking::panic'
              C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\libcompiler_builtins-1aa59d2479cb0a07.rlib(compiler_builtins-1aa59d2479cb0a07.compiler_builtins.e959a4ad-cgu.3.rcgu.o): In function `compiler_builtins::float::mul::mul':
              C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.85/src\float/mul.rs:(.text._ZN17compiler_builtins5float3mul8__muldf317h81f5d26047862690E+0x9aa): undefined reference to `core::panicking::panic'
              C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\libcompiler_builtins-1aa59d2479cb0a07.rlib(compiler_builtins-1aa59d2479cb0a07.compiler_builtins.e959a4ad-cgu.6.rcgu.o): In function `compiler_builtins::int::shift::Ashl::ashl':
              C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.85/src\int/shift.rs:15: undefined reference to `core::panicking::panic'
              C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\libcompiler_builtins-1aa59d2479cb0a07.rlib(compiler_builtins-1aa59d2479cb0a07.compiler_builtins.e959a4ad-cgu.6.rcgu.o): In function `compiler_builtins::int::shift::Lshr::lshr':
              C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.85/src\int/shift.rs:60: undefined reference to `core::panicking::panic'
              C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\libcompiler_builtins-1aa59d2479cb0a07.rlib(compiler_builtins-1aa59d2479cb0a07.compiler_builtins.e959a4ad-cgu.6.rcgu.o): In function `compiler_builtins::int::shift::Lshr::lshr':
              C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.85/src\int/shift.rs:60: undefined reference to `core::panicking::panic'
              C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\libcompiler_builtins-1aa59d2479cb0a07.rlib(compiler_builtins-1aa59d2479cb0a07.compiler_builtins.e959a4ad-cgu.8.rcgu.o):C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.85/src\float/conv.rs:27: more undefined references to `core::panicking::panic' follow
              collect2.exe: error: ld returned 1 exit status
    
      = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
      = note: use the `-l` flag to specify native libraries to link
      = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
    
    error: could not compile `accelduino-rs` due to previous error
    
    opened by kaaatsu32329 0
Owner
Katsu Uchiyama
Undergraduate student (B3) Robotics
Katsu Uchiyama
Garden monitoring system using m328p and m2560 Arduino Uno boards

Garden monitoring system using m328p and m2560 Arduino Uno boards. 100% Rust [no_std] using the avr hardware abstraction layer (avr-hal)

Ethan Gallucci 1 May 4, 2022
A fetcher hook for the Plato document reader that syncs an e-reader with an OPDS catalogue.

plato-opds A fetcher hook for the Plato document reader that syncs an e-reader with an OPDS catalogue. Motivation I wanted to be able to sync my e-rea

null 11 Nov 8, 2023
⚙️ Crate to discover embedded programming with uno r3 project

⚙️ Crate to discover embedded programming with uno r3 project

null 0 Feb 3, 2022
1️⃣ el lisp number uno - one lisp to rule them all 🏆

luno el lisp number uno luno is the one lisp to rule them all. Still experimental, do not use it in production yet. goals embeddable small size simple

Eva Pace 3 Apr 25, 2022
Moca-hcho - Bluetooth 5 BLE formaldehyde/temperature/humidity sensor beacon

moca-hcho: Bluetooth 5 BLE formaldehyde/temperature/humidity sensor beacon moca-hcho is a simple Bluetooth Low Energy sensor beacon that uses a Sensir

Joonas Javanainen 5 Nov 25, 2022
Board Support Crate for Arduino Leonardo in Rust

Deprecation Note: This crate will soon be deprecated in favor of avr-hal. avr-hal is a new approach to writing the HAL crate, that was designed with s

Rahix 5 May 6, 2021
How to use an Arduino library in a Rust project?

Example of an Arduino library usage in a Rust project The project tested with Arduino UNO on Fedora 35. It demonstrates the usage of LiquidCrystal_I2C

Konstantin 6 Dec 27, 2022
Arduino Nano frequency counter with atomic clock accuracy

Arduino Nano frequency counter with atomic clock accuracy Project description and test setup With this project you can measure a frequency from less t

Frank Buss 24 Apr 3, 2022
🖥 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
Stack buffer provides alternatives to Buf{Reader,Writer} allocated on the stack instead of the heap.

StackBuf{Reader,Writer} Stack buffer provides alternatives to BufReader and BufWriter allocated on the stack instead of the heap. Its implementation i

Alex Saveau 14 Nov 20, 2022