This gem supports the following versions of ruby, it may work on other versions but is not tested against them so don't rely on it.
- 2.7.0 - 2.7.1
Work with the NMRA's Digital Command Control standards.
Details of the gem's API can be found at https://rubydoc.info/github/robertgauld/dcc/main
If you're using bundler then add it to your Gemfile and run the bundle command.
gem 'dcc', '~> 0.1'
If you're not using bundler then install it from the command line.
gem install dcc -v '~> 0.1'
require 'dcc' # Unless you're using Bundler
Work with long loco addresses
# Get the values of CVs 17 and 18 for a given address cv17, cv18 = . 1234 # it returns [196, 210] so cv17 is 196, and cv18 is 210 # Get an address given the values of CVs 17 and 18 . 196, 210 # returns 1234
Work with CV29
# Make a value for writing to CV29 cv29 = . :speed_steps, :railcom, :long_address # cv29 is 42 # Query a value read from CV29 . cv29, :reverse_direction # returns false . cv29, :speed_steps # returns true . cv29, :dc_operation # returns false . cv29, :railcom # returns true . cv29, :complex_speed_curve # returns false . cv29, :long_address # returns true
We follow the Semantic Versioning concept.