IRrecv.resume()

来自Microduino Wikipedia
跳转至: 导航搜索


IRrecv.resume()


作用

清除红外传感器解码状态,为下一次红外接收做准备


参数


返回值


示例

/*
 * 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>

int RECV_PIN = 4;

IRrecv irrecv(RECV_PIN);

decode_results results;

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

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
}


其他

IRrecv()

decode_results

IRrecv.decode()

IRrecv.enableIRIn()