Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Lilnija_29012017 NucleoF042K6_IRReceiver
examples/IRrecvDemo/IRrecvDemo.ino@0:70c8e56bac45, 2016-01-23 (annotated)
- Committer:
- yuhki50
- Date:
- Sat Jan 23 06:16:48 2016 +0000
- Revision:
- 0:70c8e56bac45
import https://github.com/z3t0/Arduino-IRremote e3ec11d
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| yuhki50 | 0:70c8e56bac45 | 1 | /* |
| yuhki50 | 0:70c8e56bac45 | 2 | * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv |
| yuhki50 | 0:70c8e56bac45 | 3 | * An IR detector/demodulator must be connected to the input RECV_PIN. |
| yuhki50 | 0:70c8e56bac45 | 4 | * Version 0.1 July, 2009 |
| yuhki50 | 0:70c8e56bac45 | 5 | * Copyright 2009 Ken Shirriff |
| yuhki50 | 0:70c8e56bac45 | 6 | * http://arcfn.com |
| yuhki50 | 0:70c8e56bac45 | 7 | */ |
| yuhki50 | 0:70c8e56bac45 | 8 | |
| yuhki50 | 0:70c8e56bac45 | 9 | #include <IRremote.h> |
| yuhki50 | 0:70c8e56bac45 | 10 | |
| yuhki50 | 0:70c8e56bac45 | 11 | int RECV_PIN = 11; |
| yuhki50 | 0:70c8e56bac45 | 12 | |
| yuhki50 | 0:70c8e56bac45 | 13 | IRrecv irrecv(RECV_PIN); |
| yuhki50 | 0:70c8e56bac45 | 14 | |
| yuhki50 | 0:70c8e56bac45 | 15 | decode_results results; |
| yuhki50 | 0:70c8e56bac45 | 16 | |
| yuhki50 | 0:70c8e56bac45 | 17 | void setup() |
| yuhki50 | 0:70c8e56bac45 | 18 | { |
| yuhki50 | 0:70c8e56bac45 | 19 | Serial.begin(9600); |
| yuhki50 | 0:70c8e56bac45 | 20 | irrecv.enableIRIn(); // Start the receiver |
| yuhki50 | 0:70c8e56bac45 | 21 | } |
| yuhki50 | 0:70c8e56bac45 | 22 | |
| yuhki50 | 0:70c8e56bac45 | 23 | void loop() { |
| yuhki50 | 0:70c8e56bac45 | 24 | if (irrecv.decode(&results)) { |
| yuhki50 | 0:70c8e56bac45 | 25 | Serial.println(results.value, HEX); |
| yuhki50 | 0:70c8e56bac45 | 26 | irrecv.resume(); // Receive the next value |
| yuhki50 | 0:70c8e56bac45 | 27 | } |
| yuhki50 | 0:70c8e56bac45 | 28 | delay(100); |
| yuhki50 | 0:70c8e56bac45 | 29 | } |