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
`/*
- IRremoteESP8266: IRsendGCDemo - demonstrates sending Global Cache-formatted IR codes with IRsend
- An IR LED must be connected to ESP8266 pin 0.
- Version 0.1 30 March, 2016
- Based on Ken Shirriff's IrsendDemo Version 0.1 July, 2009, Copyright 2009 Ken Shirriff, http://arcfn.com
*/
include <IRremoteESP8266.h>
// 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.