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);  
}  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM