Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Risolto! aggiungere un comando IR
#6
prova un po' così

Code:
#include <IRremote.h>

IRsend irsend;


void setup() {

// Initialize Serial Port
Serial.begin(57600);

// Let uPanel to start
delay(3000);

// Discharge old partial messages and activate real-time response
Serial.println("\n$PING 200");

// Send Panel (A LED and a Switch)
Serial.println("$P:D!228;T*15:&#956Panel-Arduino Example 3;{%100,3!88F,228}*20/L1G:0:LED;*10/W1:0;");

}

String Msg;

void loop() {
int khz=38;

unsigned int Signal_ON_1[] = {4472,4316,612,1580,636,464,608,1580,608,1580,636,464,608,492,608,1580,608,492,608,488,608,1580,608,488,640,460,612,1580,608,1580,608,488,612,1580,608,484,612,488,612,1576,636,1552,612,1576,616,1580,608,1576,612,1580,608,1580,608,1580,636,464,636,460,636,460,612,488,640,460,612,484,608,488,636,1556,636,460,612,484,636,1556,612,1576,632,464,616,484,608,1580,636,460,640,1552,636,1552,636,460,612,488,612,1580,608,1576,620,5160,4476,4304,616,1576,612,484,636,1552,616,1576,612,484,616,484,612,1576,612,488,608,492,632,1556,608,488,608,492,608,1580,636,1552,612,484,612,1580,604,492,612,488,632,1556,608,1580,608,1580,608,1580,612,1580,608,1580,608,1580,608,1580,608,488,612,488,612,484,612,488,612,484,616,484,608,492,608,1580,608,488,636,460,612,1580,612,1580,608,484,640,464,608,1576,612,484,616,1580,608,1580,632,460,616,484,612,1576,612,1584,592}; //AnalysIR Batch Export (IRremote) - RAW
unsigned int Signal_OFF_0[] = {4496,4304,608,1580,612,488,608,1580,612,1580,608,484,616,484,640,1556,608,492,608,484,612,1580,612,484,616,484,608,1584,608,1580,636,464,612,1576,608,488,612,1580,612,1580,712,1476,636,1556,608,484,640,1556,608,1580,608,1584,608,484,612,488,612,488,744,356,612,1576,612,488,608,492,608,1580,636,1556,632,1556,636,460,612,488,612,484,636,464,740,360,608,488,612,484,636,460,612,1584,608,1576,612,1580,612,1580,608,1576,624,5156,4476,4308,612,1576,612,488,612,1576,616,1576,636,460,612,484,640,1556,608,488,612,484,616,1576,632,464,612,488,608,1584,632,1556,608,488,612,1580,608,488,612,1580,608,1580,612,1580,608,1580,608,488,612,1576,612,1584,604,1580,608,492,608,488,612,488,632,464,612,1580,608,492,608,488,608,1584,608,1576,612,1576,616,484,608,492,608,488,612,488,612,484,608,492,608,492,608,488,612,1576,608,1580,612,1580,608,1580,608,1584,532}; //AnalysIR Batch Export (IRremote) - RAW

int c;
while ((c = Serial.read()) > '\n') Msg += (char) c;  // Read incoming chars, if any, until new line
if (c == '\n')                                       // is the message complete?
{
  if (Msg.equals("#W10")) {Serial.println("#L10"); irsend.sendRaw(Signal_OFF_0, sizeof(Signal_OFF_0) / sizeof(Signal_OFF_0[0]), khz);}  // Turn OFF LED 1 if switch is OFF
  if (Msg.equals("#W11")) {Serial.println("#L11"); irsend.sendRaw(Signal_ON_1, sizeof(Signal_ON_1) / sizeof(Signal_ON_1[0]), khz);}     // Turn ON LED 1 if switch is ON
  Msg = "";
}
}
Reply


Messages In This Thread
Risolto! aggiungere un comando IR - by Enzo147 - 05-07-2016, 03:00 PM
RE: aggiungere un comando IR - by Dok - 05-08-2016, 06:16 PM
RE: aggiungere un comando IR - by Enzo147 - 05-08-2016, 09:37 PM
RE: aggiungere un comando IR - by Dok - 05-09-2016, 06:14 AM
RE: aggiungere un comando IR - by Enzo147 - 05-09-2016, 10:55 AM
RE: aggiungere un comando IR - by Dok - 05-09-2016, 01:28 PM
RE: aggiungere un comando IR - by Enzo147 - 05-09-2016, 05:24 PM
RE: aggiungere un comando IR - by Enzo147 - 05-10-2016, 06:43 PM
RE: Risolto! aggiungere un comando IR - by Dok - 05-10-2016, 07:56 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)