
keyestudio
www.keyestudio.cc
54
Note: when the pulse enters the integrated receiver, there will be decoding, signal amplifying and
wave shaping process. So you need to make sure the level of the output is just the opposite from that
of the signal sending end. That is when there is no infrared signal, the output end is in high
level; when there is infrared signal, the output end is in low level. You can see the pulse of the
receiving end in the oscilloscope. Try to better understand the program base on what you see.
Sample program
#include <IRremote.h>
int RECV_PIN = 11;
int LED1 = 2;
int LED2 = 3;
int LED3 = 4;
int LED4 = 5;
int LED5 = 6;
int LED6 = 7;
long on1 = 0x00FFA25D;
long off1 = 0x00FFE01F;
long on2 = 0x00FF629D;
long off2 = 0x00FFA857;
long on3 = 0x00FFE21D;
long off3 = 0x00FF906F;
long on4 = 0x00FF22DD;
long off4 = 0x00FF6897;
long on5 = 0x00FF02FD;
long off5 = 0x00FF9867;
long on6 = 0x00FFC23D;
long off6 = 0x00FFB047;
IRrecv irrecv(RECV_PIN);
decode_results results;
// Dumps out the decode_results structure.
// Call this after IRrecv::decode()
// void * to work around compiler issue
//void dump(void *v) {
// decode_results *results = (decode_results *)v
void dump(decode_results *results) {
int count = results->rawlen;
if (results->decode_type == UNKNOWN)
{
Serial.println("Could not decode message");
Содержание Basic starter kit
Страница 1: ...1 ...
Страница 10: ...keyestudio www keyestudio cc 8 Connection for 2560 R3 ...
Страница 17: ...keyestudio www keyestudio cc 15 Connection for 2560 R3 ...
Страница 21: ...keyestudio www keyestudio cc 19 Connection for 2560 R3 ...
Страница 25: ...keyestudio www keyestudio cc 23 Connection for 2560 R3 ...
Страница 29: ...keyestudio www keyestudio cc 27 Connection for 2560 R3 ...
Страница 39: ...keyestudio www keyestudio cc 37 Connection for 2560 R3 ...
Страница 43: ...keyestudio www keyestudio cc 41 Connect the sensor to analog pin 0 Connection for R3 Connection for 2560 R3 ...
Страница 62: ...keyestudio www keyestudio cc 60 Connection for 2560 R3 ...
Страница 66: ...keyestudio www keyestudio cc 64 Connection for 2560 R3 ...
Страница 77: ...keyestudio www keyestudio cc 75 Manual for LED segment display ...
Страница 78: ...keyestudio www keyestudio cc 76 Connection for R3 Connection for 2560 R3 ...
Страница 90: ...keyestudio www keyestudio cc 88 Connection for 2560 R3 ...
Страница 94: ...keyestudio www keyestudio cc 92 ...
Страница 95: ...keyestudio www keyestudio cc 93 Connection for R3 Connection for 2560 R3 ...