README.md in rf_rgb-0.8.0 vs README.md in rf_rgb-0.8.5
- old
+ new
@@ -29,19 +29,21 @@
$ gem install rf_rgb
## Usage
```ruby
+require 'rf_rgb'
+
keyboard = nil
begin
# .new without an arg will automatically find and initialize the first Realforce RGB keyboard it finds.
# Keyboard cannot be used at this point, as it's owned by this program until .release_to_os is called.
keyboard = RfRgb::Keyboard.new
keyboard.effect_rainbow_wave
- # keyboard.effect_shooting_star("\xff\x00\xff", RfRgb::Protocol::INTERVAL_6)
- # keyboard.effect_pressed_key("\xaa\xee\xff")
+ # keyboard.effect_shooting_star("ff00ff", RfRgb::Protocol::INTERVAL_6)
+ # keyboard.effect_pressed_key("aaeeff")
# keyboard.disable_effect
keyboard.brightness = RfRgb::Protocol::BRIGHTNESS_LOW
keyboard.actuation_height = RfRgb::Protocol::HEIGHT_22
keyboard.swap_caps_ctrl
keyboard.save
@@ -51,19 +53,23 @@
```
OR
```ruby
+require 'rf_rgb'
+
RfRgb::Keyboard.run_and_release do |keyboard|
keyboard.effect_rainbow_wave
keyboard.brightness = RfRgb::Protocol::BRIGHTNESS_LOW
keyboard.actuation_height = RfRgb::Protocol::HEIGHT_22
keyboard.swap_caps_ctrl
keyboard.save
end
```
+Additional examples can be found in the `examples` directory.
+
See `lib/rf_rgb/keyboard.rb` for effects and arguments, and
`lib/rf_rgb/protocol.rb` for any needed constants.
On Ubuntu Linux at least, some udev configuration was necessary to be able to run as a non-root user,
and prevent `usbhid` from taking the device over. If you're in that boat, try this:
@@ -82,10 +88,10 @@
When commands are sent from the host to the OUT endpoint, there is a response that can
be read from IN endpoint #3, but this module ignores these responses completely at
time of writing.
Some effects have a User 1-3 setting in the Windows UI. It's not clear what these
-are actually for, and are ignored in this module for now.
+are actually for, and are mostly ignored in this module for now.
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.