IRsend.sendNEC()

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


IRsend.sendNEC(data, nbits)


作用

发送编码格式为NEC的红外数据


参数

data:要发送的红外数值(unsigned long)

nbits:数值的位数(int)


返回值

无


示例

/*
 * IRremote: IRsendDemo - demonstrates sending IR codes with IRsend
 * An IR LED must be connected to Arduino PWM pin 3.
 * Microduino Core:D3
 * Microduino Core+:D8
 * Microduino CoreUSB:D6
 * Microduino CoreRF:D5
 * Version 0.1 July, 2009
 * Copyright 2009 Ken Shirriff
 * http://arcfn.com
 */

#include <IRremote.h>

IRsend irsend;

void setup()
{
  Serial.begin(9600);
}

void loop() {
  if (Serial.read() != -1) {
    for (int i = 0; i < 3; i++) {
      irsend.sendNEC(0xa90, 12); // Sony TV power code
      delay(100);
    }
  }
}


其他

【IRsend()】

【sendMedia()】

【sendSony()】

【sendRaw()】

【sendRC5()】

【sendRC6()】



返回IR_Sensor_Reference页面