crankyoldgit / IRremoteESP8266

Infrared remote library for ESP8266/ESP32: send and receive infrared signals with multiple protocols. Based on: https://github.com/shirriff/Arduino-IRremote/
GNU Lesser General Public License v2.1
2.98k stars 832 forks source link

PLEASE HELP, sendRaw, send GC. #39

Closed xiongyuxi closed 8 years ago

xiongyuxi commented 8 years ago

Currently using Arduino UNO with iRemote library to send two sets of pulses by an IR LED connected directly to pin 3 and GND, everything works smoothly.

Now I wanted to use the D1 mini, because is equipped with WiFi, but if I send the same code sequence with the library IRemoteESP8266, always with the IR LED connected directly to pin D3 and GND, nothing works. I enclose the two sketch used to tests: Arduino `/* Questo programma permette di accendere e spegnere ongni 7,5 secondi, la luce di casa led collegato a pin 3 e GND /

include "IRremote.h"

IRsend irsend;

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

unsigned int ON[68]={9150,4450,650,500,650,500,600,550,600,550,600,500,650,500,650,500,600,550,600,1650,650,1600,700,1600,600,1700,600,1650,650,1650,600,1650,650,1650,600,1700,600,500,650,1650,600,1650,650,500,600,550,600,500,650,500,650,500,600,1700,600,500,650,500,650,1600,650,1650,650,1650,600,1650,650}; unsigned int OFF[68]={9150,4500,600,500,650,500,600,550,600,550,600,500,650,500,650,500,600,550,600,1650,650,1600,700,1600,650,1650,600,1650,650,1650,600,1650,650,1650,600,1700,600,1650,600,1650,650,1650,650,1650,600,500,650,500,600,550,600,550,600,500,650,500,600,550,600,500,650,1650,600,1650,650,1650,600};

void loop() { irsend.sendRaw(ON, 68, 38); Serial.println("Accendo la Lampada"); delay(7500); irsend.sendRaw(OFF, 68, 38); Serial.println("Spengo la Lampada"); delay(7500); }`

D1 `/*

// Codes are in Global Cache format less the emitter ID and request ID. These codes can be found in GC's Control Tower database.

unsigned int ON[69]={38000,9150,4450,650,500,650,500,600,550,600,550,600,500,650,500,650,500,600,550,600,1650,650,1600,700,1600,600,1700,600,1650,650,1650,600,1650,650,1650,600,1700,600,500,650,1650,600,1650,650,500,600,550,600,500,650,500,650,500,600,1700,600,500,650,500,650,1600,650,1650,650,1650,600,1650,650}; unsigned int OFF[69]={38000,9150,4500,600,500,650,500,600,550,600,550,600,500,650,500,650,500,600,550,600,1650,650,1600,700,1600,650,1650,600,1650,650,1650,600,1650,650,1650,600,1700,600,1650,600,1650,650,1650,650,1650,600,500,650,500,600,550,600,550,600,500,650,500,600,550,600,500,650,1650,600,1650,650,1650,600};

IRsend irsend(0); //an IR emitter led is connected to GPIO pin D3

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

void loop() { Serial.println("Toggling power ON"); irsend.sendGC(ON, 69); delay(5000); Serial.println("Toggling power OFF"); irsend.sendGC(OFF, 69); delay(5000); }`

I also tried the sendraw but did not work.

xiongyuxi commented 8 years ago

problem solved, I changed the rawBuf in IRremoteESP8266.h and it goes well