Last active
December 11, 2015 22:58
-
-
Save masquaremo/4673063 to your computer and use it in GitHub Desktop.
Raspberry PiのPWM制御をライブラリ化し、Rubyから使用するサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pwmlib' | |
pwm = Pwmlib | |
pwm.set_range(1000) | |
0.step(1000, 100) do |i| | |
sleep(1) | |
puts "d=#{i}" | |
pwm.set_duty(i) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment