Skip to content

Instantly share code, notes, and snippets.

@masquaremo
Last active December 11, 2015 17:38
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/4635396 to your computer and use it in GitHub Desktop.
Save masquaremo/4635396 to your computer and use it in GitHub Desktop.
Raspberry Pi(Raspbian)のRubyでGPIO4のLチカ(デバイスファイル使用)
#!/usr/bin/ruby
system('echo "4" > /sys/class/gpio/export')
system('echo "out" > /sys/class/gpio/gpio4/direction')
[0, 1].cycle do |sw|
system("echo #{sw} > /sys/class/gpio/gpio4/value")
sleep(0.5)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment