本帖最后由 瘦网虫 于 2013-2-19 17:03 编辑
arduino端部分代码,自我觉得代码中有价值的部分就是发送有线电视控制信号部分。
发送 类型为unkown,长度为100的红外编码。
- #include <EtherCard.h>
- #include <IRremote.h>
- static byte mymac[] = {
- 0x74,0x69,0x69,0x2D,0x30,0x31};
- static byte myip[] = {
- 192,168,2,10};
- // gateway ip address
- static byte gwip[] = {
- 192,168,2,1 };
- static byte dnsip[] = {
- 192,168,2,1 };
- byte Ethernet::buffer[700];
- static uint32_t timer;
- #define gPB ether.buffer
- #define UDP_DP_HIGH 36
- #define UDP_DP_LOW 37
- #define DSTPORT_HIHG 0x26
- #define DSTPORT_LOW 0xe7
- Stash stash;
- const int CHANGE_CHANNEL = 1;
- const int CHANGE_VOLUME = 2;
- int cmd =0;
- int cmdValue =-32768;
- const int irReceiverPin = 7;
- int STATUS_PIN = 13;
- IRrecv irrecv(irReceiverPin); // 设置irReceiverPin定义的端口为红外信号接收端口
- decode_results results; // 定义results变量为红外结果存放位置
- IRsend irsend;
- const int ledPin = 13;
- boolean ledStatus;
- char* on = "1";
- char* off = "0";
- char* statusLabel;
- char* buttonLabel;
- // Storage for the recorded code
- int codeType = -1; // The type of code
- unsigned long codeValue; // The code value if not raw
- unsigned int rawCodes[RAWBUF]; // The durations if raw
- unsigned int rawCodes_voldown[100] = {
- 3550 ,1850 ,300 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,1400 ,300 ,450 ,300 ,400 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,1400 ,300 ,450 ,300 ,400 ,350 ,1400 ,300 ,1400 ,300 ,450 ,300 ,1400 ,300 ,450 ,300 ,450 ,300 ,450 ,300 ,400 ,350 ,1400 ,300 ,1400 ,300 ,450 ,300 ,1400 ,300 ,450 ,300 ,450 ,300 ,450 ,300 ,1400 ,350 ,1350 ,300 ,450 ,300 ,450 ,300 ,1400 ,300 ,450 ,300 ,1400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,300 ,450 ,300
- };//checked
- unsigned int rawCodes_volup[100] = {
- 3600 ,1800 ,300 ,450 ,300 ,450 ,300 ,400 ,350 ,1400 ,300 ,450 ,300 ,400 ,350 ,1400 ,300 ,450 ,300 ,400 ,350 ,1400 ,300 ,1400 ,350 ,350 ,350 ,400 ,350 ,400 ,350 ,1400 ,300 ,450 ,300 ,1400 ,300 ,450 ,300 ,450 ,300 ,1400 ,300 ,1400 ,300 ,450 ,300 ,1400 ,300 ,450 ,300 ,450 ,300 ,450 ,300 ,450 ,300 ,1400 ,300 ,1400 ,300 ,450 ,300 ,1400 ,350 ,400 ,300 ,450 ,300 ,1400 ,350 ,400 ,300 ,450 ,300 ,1400 ,350 ,400 ,300 ,1400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,300 ,1400 ,350 ,400 ,350 ,400 ,300 ,1400 ,350 ,400 ,350
- };//checked
- unsigned int rawCodes_channelup[100] = {
- 3500 ,1850 ,300 ,450 ,250 ,500 ,250 ,500 ,250 ,1450 ,250 ,500 ,250 ,500 ,250 ,1450 ,250 ,500 ,250 ,500 ,250 ,1450 ,250 ,1450 ,300 ,450 ,300 ,450 ,250 ,500 ,250 ,1450 ,300 ,450 ,250 ,1450 ,300 ,450 ,300 ,450 ,250 ,1450 ,300 ,1450 ,250 ,450 ,300 ,1450 ,250 ,500 ,250 ,450 ,300 ,450 ,300 ,450 ,250 ,1450 ,300 ,1450 ,250 ,500 ,250 ,1450 ,250 ,500 ,250 ,1450 ,250 ,500 ,250 ,1450 ,250 ,500 ,250 ,1450 ,250 ,500 ,250 ,1450 ,250 ,500 ,250 ,500 ,250 ,500 ,250 ,500 ,250 ,500 ,250 ,1450 ,250 ,500 ,250 ,1450 ,250 ,500 ,250
- };//checked
- unsigned int rawCodes_channeldown[100] = {
- 3550 ,1850 ,300 ,450 ,300 ,400 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,1400 ,300 ,1400 ,300 ,450 ,300 ,450 ,300 ,400 ,350 ,1400 ,300 ,450 ,300 ,1400 ,300 ,450 ,300 ,450 ,300 ,1400 ,300 ,1400 ,300 ,450 ,300 ,1400 ,300 ,450 ,300 ,450 ,300 ,450 ,300 ,450 ,300 ,1400 ,300 ,1400 ,300 ,450 ,300 ,1400 ,300 ,450 ,300 ,450 ,300 ,450 ,300 ,1400 ,300 ,450 ,300 ,450 ,300 ,450 ,300 ,1400 ,300 ,450 ,300 ,1400 ,300 ,1400 ,300 ,1400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350
- };//checked
- unsigned int rawCodes_ok[100] = {
- 3500 ,1900 ,250 ,500 ,250 ,450 ,300 ,450 ,300 ,1450 ,250 ,450 ,300 ,450 ,300 ,1450 ,250 ,450 ,300 ,450 ,300 ,1450 ,250 ,1450 ,250 ,500 ,250 ,500 ,250 ,450 ,300 ,1450 ,250 ,500 ,250 ,1450 ,250 ,500 ,250 ,500 ,250 ,1450 ,250 ,1450 ,250 ,500 ,250 ,1450 ,250 ,500 ,250 ,500 ,250 ,500 ,250 ,500 ,250 ,1450 ,250 ,1450 ,250 ,500 ,250 ,1450 ,250 ,500 ,250 ,1450 ,250 ,500 ,250 ,1450 ,250 ,500 ,250 ,500 ,250 ,500 ,250 ,1450 ,250 ,500 ,250 ,500 ,250 ,1450 ,250 ,1450 ,300 ,1400 ,300 ,450 ,300 ,450 ,300 ,1400 ,300 ,450 ,300
- };//checked
- unsigned int rawCodes_num1[100] = {
- 3550 ,1800 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,1350 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,1400 ,300 ,400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,1400 ,300 ,400 ,350 ,400 ,350
- };
- unsigned int rawCodes_num2[100] = {
- 3550 ,1850 ,300 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,1400 ,350 ,350 ,350 ,400 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,1400 ,350 ,350 ,350 ,400 ,350 ,1400 ,350 ,1350 ,350 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,350 ,400 ,350 ,1400 ,350 ,1350 ,350 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,350 ,400 ,350 ,1400 ,350 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,350 ,1400 ,350 ,350 ,400 ,350 ,350 ,1400 ,350 ,1350 ,350 ,350 ,400 ,350 ,400
- };
- unsigned int rawCodes_num3[100] = {
- 3600 ,1800 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,1350 ,350 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,1350 ,350 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,1350 ,350 ,1350 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,1350 ,350 ,1350 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,1350 ,350 ,1350 ,350 ,400 ,350 ,350 ,400 ,1350 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,1400 ,300 ,400 ,350 ,400 ,350
- };
- unsigned int rawCodes_num4[100] = {
- 3600 ,1800 ,350 ,350 ,350 ,400 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,1400 ,300 ,1400 ,350 ,350 ,400 ,350 ,350 ,400 ,350 ,1400 ,350 ,350 ,350 ,1400 ,350 ,350 ,400 ,350 ,350 ,1400 ,350 ,1350 ,350 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,400 ,1350 ,350 ,1350 ,350 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,350 ,1400 ,350 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,350 ,1400 ,350 ,350 ,400 ,1350 ,350 ,1350 ,350 ,350 ,400 ,350 ,400
- };
- unsigned int rawCodes_num5[100] = {
- 3600 ,1800 ,350 ,350 ,400 ,350 ,400 ,350 ,350 ,1400 ,350 ,350 ,400 ,350 ,350 ,1400 ,350 ,350 ,400 ,350 ,350 ,1400 ,350 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,1350 ,350 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,1350 ,350 ,1350 ,350 ,350 ,400 ,1350 ,350 ,400 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,1350 ,350 ,1350 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,1350 ,350 ,1350 ,350 ,400 ,350 ,350 ,400 ,1350 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,1350 ,350 ,1400 ,300 ,400 ,350 ,400 ,350
- };
- unsigned int rawCodes_num6[100] = {
- 3600 ,1800 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,350 ,1400 ,350 ,350 ,400 ,350 ,350 ,1400 ,350 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,1350 ,350 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,1350 ,350 ,1350 ,350 ,350 ,400 ,1350 ,350 ,400 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,1350 ,350 ,1350 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,1350 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,350 ,400 ,1350 ,350 ,1350 ,350 ,400 ,350 ,1350 ,350 ,1400 ,300 ,400 ,350 ,400 ,350
- };
- unsigned int rawCodes_num7[100] = {
- 3600 ,1800 ,350 ,350 ,350 ,400 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,1400 ,300 ,1400 ,350 ,350 ,400 ,350 ,350 ,400 ,350 ,1400 ,350 ,350 ,350 ,1400 ,350 ,350 ,400 ,350 ,350 ,1400 ,350 ,1350 ,350 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,400 ,1350 ,350 ,1350 ,350 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,350 ,1400 ,350 ,1350 ,350 ,350 ,400 ,350 ,400 ,1350 ,350 ,1350 ,350 ,1350 ,350 ,400 ,350 ,1350 ,350 ,1400 ,300 ,400 ,350 ,400 ,350
- };
- unsigned int rawCodes_num8[100] = {
- 3550 ,1850 ,300 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,1400 ,300 ,1400 ,350 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,350 ,400 ,350 ,1400 ,350 ,1350 ,350 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,350 ,400 ,350 ,1400 ,350 ,1350 ,350 ,350 ,400 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,1400 ,300 ,1400 ,350 ,1350 ,350 ,350 ,400 ,350 ,400
- };
- unsigned int rawCodes_num9[100] = {
- 3550 ,1800 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,1400 ,300 ,1400 ,350 ,350 ,350 ,1400 ,350 ,350 ,400 ,350 ,350 ,400 ,350 ,400 ,350 ,1400 ,300 ,1400 ,350 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,350 ,400 ,350 ,400 ,350 ,1400 ,300 ,1400 ,350 ,350 ,400 ,350 ,350 ,1400 ,350 ,350 ,400 ,350 ,350 ,1400 ,350 ,1350 ,350 ,1350 ,350 ,350 ,400 ,350 ,400
- };
- unsigned int rawCodes_num0[100] = {
- 3550 ,1800 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,350 ,350 ,1400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,400 ,300 ,1400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,1350 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,1400 ,300 ,400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,400 ,300 ,1400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,350 ,400 ,1350 ,350 ,1350 ,350 ,400 ,350 ,400 ,350
- };unsigned int rawCodes_invalid[100] = {
- 3550 ,1800 ,350 ,350 ,350 ,350 ,350 ,400 ,350 ,1350 ,350 ,350 ,350 ,350 ,350 ,1350 ,350 ,350 ,350 ,350 ,350 ,1400 ,350 ,1350 ,350 ,350 ,350 ,400 ,350 ,400 ,300 ,1400 ,350 ,400 ,350 ,1350 ,350 ,350 ,350 ,400 ,350 ,1350 ,350 ,1350 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,350 ,350 ,350 ,350 ,350 ,350 ,1350 ,350 ,1400 ,300 ,400 ,350 ,1400 ,300 ,400 ,350 ,350 ,350 ,350 ,350 ,400 ,350 ,400 ,300 ,1400 ,350 ,1400 ,300 ,400 ,350 ,350 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,350 ,400 ,1350 ,350 ,1350 ,350 ,400 ,350 ,400 ,350
- };
- //assign IR code in the map
- unsigned int* codeMap[50] =
- {
- //codeMap0-9
- rawCodes_num0,rawCodes_num1,rawCodes_num2,rawCodes_num3,rawCodes_num4,rawCodes_num5,rawCodes_num6,rawCodes_num7,rawCodes_num8,rawCodes_num9,
- rawCodes_channelup,//codeMap[10]
- rawCodes_channeldown,//codeMap[11]
- rawCodes_volup,//codeMap[12]
- rawCodes_voldown,//codeMap[13]
- rawCodes_ok,//codeMap[14]
- rawCodes_invalid//codeMap[15]
- };
- //unsigned int* (*codeMap)[5]={rawCodes_num0,rawCodes_num1};
- int codeLen; // The length of the code
- int toggle = 0; // The RC5/6 toggle state
- boolean dnsStatus = false;
- int lastButtonState;
- String cmdUrl;
- void setup () {
- Serial.begin(9600); // 开启串口,波特率为9600
- irrecv.enableIRIn(); // 启动红外解码
- pinMode(STATUS_PIN, OUTPUT);
- // attachInterrupt(INT_NUM,handleCommand,CHANGE);
- if (!ether.begin(sizeof Ethernet::buffer, mymac, 53))
- Serial.println( "Failed to access Ethernet controller");
- else
- Serial.println("Ethernet controller initialized");
- if (!ether.staticSetup(myip, gwip,dnsip))
- Serial.println("Failed to set IP address");
- // if (!ether.dhcpSetup())
- // Serial.println("DHCP failed");
- ether.printIp("IP: ", ether.myip);
- ether.printIp("GW: ", ether.gwip);
- ether.printIp("DNS: ", ether.dnsip);
- Serial.println();
- pinMode(ledPin, OUTPUT);
- digitalWrite(ledPin, LOW);
- ledStatus = false;
- }
- void loop() {
- if(!dnsStatus)
- {
- if (!ether.dnsLookup(website))
- Serial.println("DNS failed");
- else dnsStatus = true;
- ether.printIp("SRV: ", ether.hisip);
- }
- word len = ether.packetReceive();
- word pos = ether.packetLoop(len);
- if (millis() > timer) {
- timer = millis() + 10000;
- Serial.println();
- if(len)
- {
- if(gPB[IP_PROTO_P]==IP_PROTO_UDP_V)
- {
- if((gPB[UDP_DP_HIGH]==DSTPORT_HIHG)&&(gPB[UDP_DP_LOW]==DSTPORT_LOW))
- {
- Serial.println("---Received an udp 9959 packet---");
- Serial.println((char *)gPB+42);
- String cmdUrl =(char *)gPB+42;
- cmd = getCmdValue(cmdUrl,"cmd");
- cmdValue = getCmdValue(cmdUrl,"value");
- if(cmd > 0)
- {
- handleCommand(cmd);
- }
-
- }
- }
- }
- if (irrecv.decode(&results)) { // 解码成功,把数据放入results变量中
- // 把数据输入到串口
- Serial.print("irCode: ");
- Serial.print(results.value, HEX); // 显示红外编码
- Serial.print(", bits: ");
- Serial.println(results.bits); // 显示红外编码位数
- // digitalWrite(ledPin,HIGH);//LED点亮
- // delay(10);
- // digitalWrite(ledPin,LOW);//LED熄灭
- irrecv.resume(); // 继续等待接收下一组信号
- // irsend.sendRC6(0x30D0000A, 32);
- // delay(10);
- // irsend.sendRC6(0x30D0000A, 32);
- }
- }
- void changeChannel(int chnId)
- {
- int chnDigi = 0;
- for(int i = 100;i>0.1;i=i/10)
- {
- chnDigi = chnId/i;
- remoterKeyPress(chnDigi,2);
- //send invalid code between each key press
- irsend.sendNEC(0xFFFFFFFF, 32);
- chnId = chnId % i;
- }
- remoterKeyPress(14,1);
- }
- void remoterKeyPress(int mapId,int times)
- {
- for (int i = 0;i<times;i++)
- {
- irsend.sendRaw(codeMap[mapId], 100, 38);
- delay(40);
- Serial.println("Key Pressed");
- Serial.println(mapId);
- }
- }
- int getCmdValue(String str,char* cmd)
- {
- if(str.indexOf(cmd) == -1)
- {
- return cmdValue;
- }
- String temp = str.substring(str.indexOf(cmd)+strlen(cmd)+1);
- if(temp.indexOf("&") > 0 )
- {
- cmdValue = temp.substring(0,temp.indexOf("&")).toInt();
- }
- else
- {
- cmdValue = temp.toInt();
- }
- return cmdValue;
- }
- void handleCommand(int cmd)
- {
- Serial.println("\n command requested..!");
- switch (cmd)
- {
- case CHANGE_CHANNEL:
- if(cmdValue > 0 )
- {
- changeChannel(cmdValue);
- }
- break;
- case CHANGE_VOLUME:
- if(cmdValue> 0 )
- {
- irsend.sendRaw(rawCodes_volup, 100, 38);
- Serial.println("-------volume up---------");
- }
- else
- {
- irsend.sendRaw(rawCodes_voldown, 100, 38);
- Serial.println("-------volume down---------");
- }
- break;
- }
- cmd = 0;
- }
- void sendCode(int repeat) {
- if (codeType == NEC) {
- if (repeat) {
- irsend.sendNEC(REPEAT, codeLen);
- Serial.println("Sent NEC repeat");
- }
- else {
- irsend.sendNEC(codeValue, codeLen);
- Serial.print("Sent NEC ");
- Serial.println(codeValue, HEX);
- }
- }
- else if (codeType == SONY) {
- irsend.sendSony(codeValue, codeLen);
- Serial.print("Sent Sony ");
- Serial.println(codeValue, HEX);
- }
- else if (codeType == RC5 || codeType == RC6) {
- if (!repeat) {
- // Flip the toggle bit for a new button press
- toggle = 1 - toggle;
- }
- // Put the toggle bit into the code to send
- codeValue = codeValue & ~(1 << (codeLen - 1));
- codeValue = codeValue | (toggle << (codeLen - 1));
- if (codeType == RC5) {
- Serial.print("Sent RC5 ");
- Serial.println(codeValue, HEX);
- irsend.sendRC5(codeValue, codeLen);
- }
- else {
- irsend.sendRC6(codeValue, codeLen);
- Serial.print("Sent RC6 ");
- Serial.println(codeValue, HEX);
- }
- }
- else if (codeType == UNKNOWN /* i.e. raw */) {
- // Assume 38 KHz
- // irsend.sendRaw(rawCodes, codeLen, 38);
- irsend.sendRaw(rawCodes_volup, 100, 38);
- Serial.println("Sent raw");
- }
- }
复制代码 |