SCR638红外接收管介绍

注意:使用的是数字输出,不是模拟量输出

VCC 对应电路板上的Power supply,vin的电压是5V也可以使用

程序:

/* 
 * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv 
 * An IR detector/demodulator must be connected to the input RECV_PIN. 
 * Version 0.1 July, 2009 
 * Copyright 2009 Ken Shirriff 
 * http://arcfn.com 
 */  
  
#include <IRremote.h>     // IRremote库声明  
  
int RECV_PIN = 3;        //定义红外接收器的引脚为11  
  
IRrecv irrecv(RECV_PIN);   
  
decode_results results;  
  
void setup()  
{  
  Serial.begin(9600);  
  irrecv.enableIRIn(); // 启动接收器  
}  
  
void loop() {  
  if (irrecv.decode(&results))   
  {  
    Serial.println(results.value, HEX);//以16进制换行输出接收代码  
    irrecv.resume(); // 接收下一个值  
  }  
  delay(100);  
}  
钟声敲响了日落
原文地址:https://www.cnblogs.com/SATinnovation/p/7747627.html