Created
February 1, 2013 12:57
-
-
Save fukayatsu/4691160 to your computer and use it in GitHub Desktop.
pryとDinoで3色LED
This file contains hidden or 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
| 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