Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Arduino i rremote 1112

5,758 views

Published on

Published in: Technology, Business
  • Be the first to comment

Arduino i rremote 1112

  1. 1. Arduino 紅外線遙控 Cooper Maa德明 Arduino 開發經驗分享 - 2011
  2. 2. Arduino ARRRR, // DWEE, just say "do we“ fast / / NO, as in no.”ARRR-DWEE-NO”
  3. 3. What is Arduino?• Open Source + Software IDE + Community Hardware
  4. 4. What is for today?• 接收紅外線訊號• A Simple DIY IR Decoder• 發射紅外線訊號• DIY Keypad Remote Control
  5. 5. Infrared Remote Control• 非常普遍使用的無線通訊• 用於電視、冷氣、DVD Player、MP3 Player, 玩 具遙控車等各種設備的控制
  6. 6. Arduino & IRRemote• With Arduino & IRRemote Library, you can make your own infrared applications.
  7. 7. What you need?• First, you need an Arduino board and an USB cable
  8. 8. What you need?• Second, you need Arduino IDE to write program
  9. 9. What you need?• Third, an infrared receiver and a 940 nm Infrared LED (a.k.a Infrared Emitter)
  10. 10. What you need?• Last, download and install IRRemote Library: http://goo.gl/2HKLm
  11. 11. Make sure things work• Load "File > Examples > 1.Basics > Blink"
  12. 12. Examples used in this opentalk• For your convenience, the examples used in this opentalk has been uploaded to google doc, you can download the examples from the following url: http://goo.gl/KSOu6
  13. 13. What is for today?• 接收紅外線訊號• A Simple DIY IR Decoder• 發射紅外線訊號• DIY Keypad Remote Control
  14. 14. 接收紅外線訊號• The wiring:
  15. 15. 接收紅外線訊號• Load "File > Sketchbook > IRRemoteExamples > Example1_1"
  16. 16. 接收紅外線訊號• Try your remote:
  17. 17. 接收紅外線訊號• Open Serial Monitor and see the result:
  18. 18. Four steps to receive Infrared signals 1. 引用 IRRemote 函式庫: #include <IRremote.h> 2. 建立 IRrecv 物件及 decode_results變數: const int irReceiverPin = 2; // 紅外線接收器 VOUT 腳位 IRrecv irrecv(irReceiverPin); // 用來接收紅外線訊號 decode_results results; // 用來存放解碼結果 3. 啟動紅外線解碼: irrecv.enableIRIn(); // 啟動紅外線解碼 4. 檢查有沒收到紅外線: if (irrecv.decode(&results)) { // 解碼成功…
  19. 19. decode_results structure• The structure of decode_results
  20. 20. decode_results structure• The structure of decode_results
  21. 21. 顯示紅外線協定種類• Load "File > Sketchbook > IRRemoteExamples > Example1_2"
  22. 22. 顯示紅外線協定種類• Open Serial Monitor and see the result:
  23. 23. Infrared LED Indicator• Load "File > Sketchbook > IRRemoteExamples > Example1_3v2"
  24. 24. Infrared LED Indicator• The infrared LED indicator will blink when infrared signal is received.
  25. 25. What is for today?• 接收紅外線訊號• A Simple DIY IR Decoder• 發射紅外線訊號• DIY Keypad Remote Control
  26. 26. A simple DIY IR Decoder• http://coopermaa2nd.blogspot.com/2011/03/14-lcd-ir-decoder.html• The Wiring:
  27. 27. A simple DIY IR Decoder• Load from http://goo.gl/2qFfC
  28. 28. A simple DIY IR Decoder• The result of decoded infrared signals will shown on the LCD:
  29. 29. What is for today?• 接收紅外線訊號• A Simple DIY IR Decoder• 發射紅外線訊號• DIY Keypad Remote Control
  30. 30. 發射紅外線訊號• The wiring (IR LED 一定要接在 pin 3):
  31. 31. 發射紅外線訊號• Load "File > Sketchbook > IRRemoteExamples > Example2_1"
  32. 32. Three steps to send Infrared signals1. 引用 IRRemote 函式庫: #include <IRremote.h>2. 建立 IRsend 物件: IRsend irsend; // 定義 IRsend 物件來發射紅外線訊號3. 呼叫對應的 sendXXX() 函式發射紅外線訊號: irsend.sendNEC(0x4FB48B7, 32); // 記得換成你的紅外線編碼
  33. 33. DIY Keypad Remote Control• http://coopermaa2nd.blogspot.com/2011/04/22-keypad.html• The Wiring:
  34. 34. DIY Keypad Remote Control• Load from http://goo.gl/Tr4a7
  35. 35. DIY Keypad Remote Control• Now you have made a simple Remote Control using Keypad and just a simple infrared LED:
  36. 36. Questions?
  37. 37. References• IRRemote 紅外線遙控教學• 紅外線遙控原理與 NEC IR Protocol• WinLIRC 紅外線遙控電腦

×