Skip to content

Instantly share code, notes, and snippets.

@fukayatsu
Created February 1, 2013 12:57
Show Gist options
  • Select an option

  • Save fukayatsu/4691160 to your computer and use it in GitHub Desktop.

Select an option

Save fukayatsu/4691160 to your computer and use it in GitHub Desktop.
pryとDinoで3色LED
pry -rdino
> board = Dino::Board.new Dino::TxRx.new
> rgb_led = Dino::Components::RgbLed.new(board: board, pins: {red: 9, blue: 10, green: 11})
> rgb_led.red
> rgb_led.blue
> rgb_led.green
> [:red, :blue, :green].cycle do |color|
> rgb_led.send color
> sleep 1
> end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment