IntelGalileo
Gem for interacting with Intel Galileo board with support for Digital In/Out Pins (0 - 13), Analog In Pins (A0-A5) and PWM pins [3,5,6,9,10,11].
Ruby installation on Galileo
Some images have devtools installed on board by default - in that case compile ruby from source.
If you don't have gcc on board, follow custom image installation and customization posts.
Installation
If you have ruby installed, add this line to your application's Gemfile:
gem 'intel_galileo'
And then execute:
$ bundle
Or install it yourself as:
$ gem install intel_galileo
Usage
Digital In:
led = IntelGalileo::DigitalPin.new(7)
led.write(1) # Write 0 or 1
Digital Out:
button = IntelGalileo::DigitalPin.new(5)
puts button.read # returns 0 or 1
Analog In:
potentiometer = IntelGalileo::AnalogInPin.new('A0')
puts potentiometer.read # returns value between 0 and 4095
PWM:
led = IntelGalileo::Pwm.new(3)
led.on(50) # led will be dimmed (50% of the brightness)
led.off
For more examples please see /examples
folder
TODO
Found a bug? Something missing? Report it!
Contributing
If you wish to help and looking for inspiration see list of bugs/enhancements.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request