Project

bitwizard

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby library for controlling the BitWizard boards over SPI and I2C
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

BitWizard-Ruby Gem Version

Ruby library for controlling the BitWizard boards (over both SPI and I2C, though only SPI is tested for now) Built using pi_piper, so for now it only works on the Raspberry Pi

Installation

Just run # gem install bitwizard as root to install the library.

Examples

Reading PWM values from a spi_3fets board would be something as simple as;

require 'bitwizard'

board = BitWizard::Board.detect address: 0x8a
puts "#{board.type}:"
(1..3).each do |i|
  puts "  #{board[i]}"
end

If you want to use the i2c version of the board all you would have to do is add bus: :i2c

board = BitWizard::Board.detect address: 0x8a, bus: :i2c

You can also use the bitwizardctl utility to perform simple actions without writing your own software, things like;

  • Reading/Writing PWM values
  • Getting/Setting stepper position/target/delay
  • Spinning/Stopping motors