Skip to content

Instantly share code, notes, and snippets.

@masquaremo
Last active December 11, 2015 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masquaremo/4673063 to your computer and use it in GitHub Desktop.
Save masquaremo/4673063 to your computer and use it in GitHub Desktop.
Raspberry PiのPWM制御をライブラリ化し、Rubyから使用するサンプル
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