Start physical computing with Ruby + Arduino

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Start physical computing with Ruby + Arduino - Presentation Transcript

    1. Ruby と Arduino で始める フィジカルコンピューティング CSNagoya 豊吉隆一郎
    2. 自己紹介
      • Toyoshi
      • http://www.jamboree.jp/
      • CSNagoya所属
      • 趣味マラソン 年間1,000キロ以上
    3. Arduino(アルドゥイーノ)とは
      • I/O モジュールと開発環境一式のこと
      • PC から簡単にセンサやアクチュエータを操作できる
      • 基本は USB + AVR マイコン
      • オープンソースなので互換品もあるよ
      • (オレデュイーノと呼ばれる)
      • Make とかで人気
    4. どんなことができるのか
      • 胎児がおなかを蹴ったらTwitterに投稿
      • 自動で植物に水をやる機械
      • 光の残像で表示する電光掲示板
      • Web経由でラジコンを操作する
      • やってみたいなが”簡単に”できる!
    5. 準備(道具・ソフト)
      • Arduino Duemilanove( 基本のモジュール)
        • さまざまなバリエーションがある
      • ソフトウェア
        • Arduino IDE(Processing,wiring)
        • Pduino ( Max,Pure Data)
        • RAD(Ruby Arduino Development)
      • お好みの電子部品
    6. RADを使うとこんな風に書ける class MySketch < ArduinoSketch output_pin 7, :as => :led def loop blink led, 500 end end 7 番ピンに led という名前をつけて、 0.5 秒ごとに点滅させる
    7. LED点灯の応用
      • デモ
      資料注)マトリックス LED が点灯し文字が表示される
    8. もう少し複雑なデモ
      • はてなスターがついたらパトライト点灯
      Add star Hatena Web hook sinatra druby Arduino パトライト 点灯! Gainer
    9. Ruby と Arduino フィジカルコンピューティング CSNagoya 豊吉隆一郎 と Gainer で始める 資料注) Arduino が故障したため
    10. デモ準備
    11. デモ用URL http://b.hatena.ne.jp/toyoshi/ > 誰かがスターをつけると光ります > 誰かがスターをつけると光ります > 誰かがスターをつけると光ります
    12. サーバのコードはこんな感じ require 'rubygems' require 'sinatra' require 'drb/drb' post '/' DRb.start_service $ts = DRbObject.new_with_uri('druby://localhost:12345') $ts.write([&quot;add-star&quot;, param[:username]) end WebHook からポストがあったら dRuby に投げる     dRuby(rinda) は irb で動作している 注文が集中しています: http://b.hatena.ne.jp/toyoshi/
    13. Gainer側のコードはこんな感じ $: << '.' require 'drb/drb' require 'funnel' include Funnel DRb.start_service $ts = DRbObject.new_with_uri('druby://192.168.24.110:12345') gio = Gainer.new() loop { p $ts.take([&quot;take-test&quot;, nil]) gio.aout(0).value = 1 sleep(5) gio.aout(0).value = 0 } タプルスペース( rinda) に take して取れたら アナログアウトに出力するだけ 注文が集中しています: http://b.hatena.ne.jp/toyoshi/
    14. まとめ
      • ArduinoとRubyを使って簡単にフィジカルコンピューティングができることがわかった
    15. ご清聴有難うございました。
    SlideShare Zeitgeist 2009

    + toyoshitoyoshi Nominate

    custom

    441 views, 0 favs, 3 embeds more stats

    名古屋Ruby会議01での「RubyとArduinoでは more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 441
      • 337 on SlideShare
      • 104 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 2
    Most viewed embeds
    • 102 views on http://www.jamboree.jp
    • 1 views on http://translate.googleusercontent.com
    • 1 views on http://74.125.153.132

    more

    All embeds
    • 102 views on http://www.jamboree.jp
    • 1 views on http://translate.googleusercontent.com
    • 1 views on http://74.125.153.132

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories