2019年1月20日 星期日

紅外線接收

http://blog.udn.com/andy840119/15096120
https://github.com/coopermaa/Arduino-IRremote


#include <IRremote.h>
long  i;
int RECV_PIN = 6;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
  Serial.begin(9600);
  pinMode(9, OUTPUT);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
     i = results.value;
    Serial.println(i, HEX);
    Serial.println(i, DEC);
    Serial.println(i);
    irrecv.resume(); // Receive the next value
  }
    if(i==16753245 or i==-484956645){digitalWrite(9,HIGH);}
    if(i==5316027 or i==16736925){digitalWrite(9,LOW);}

}

沒有留言:

張貼留言

市場恐慌,但你可能都想錯了?揭示當前幣圈 5 個反直覺的驚人真相

  當前市場瀰漫著恐懼。比特幣價格跌破了被視為關鍵心理支撐的 $108,000 美元價位,負面消息鋪天蓋地而來,社群中充斥著熊市即將來臨的呼聲。在這種普遍的恐慌情緒下,許多投資者感到焦慮,認為賣出是唯一的選擇。 然而,在恐慌性拋售的浪潮之下,更深入的分析是否會揭示一個完全不同的故...