Comments (22)
To GND by default
from irremoteesp8266.
When we put LED IR to GPIO0 ESP 8266 ESP 12E always at programming mode, can I change to another GPIO ?
from irremoteesp8266.
Sure, just use eg. irsend(1) instead of irsend(0) and connect your ir led to GPIO1
from irremoteesp8266.
if connect the gpio0 to the led the esp would go in flashmode, change to gpio2 the blue light on the esp-01 stay bright (uart-mode?)
someone a simple idea how to solve that problem??
http://www.esp8266.com/viewtopic.php?f=13&t=1730
from irremoteesp8266.
Use irsend(5) to use gpio05
from irremoteesp8266.
from irremoteesp8266.
Sorry
I think, you need to use esp12E, there is more pin to use.
Gpio00 and gpio02 can't be used for ir send.
from irremoteesp8266.
If you are not using Serial, there are two more pins available (rx and tx) in esp8266-01 that can be used like regular gpio.
from irremoteesp8266.
thanks for the hint :)
i would try this solution first
if this won't work i'll try to get out another gpio directly from the chip.
from irremoteesp8266.
I think you may be able to use GPIO0 and GPIO2 for irsend, if you connect the led in reverse order, and change the library a bit.
1.) Connect the led to any pin and the other leg of the led to Vcc (instead of normal GND). Use resistor as usual.
2.) Open IRremoteESP8266.cpp in text editor and go to line 305, to function IRsend::mark(int time). You need to change the following lines:
310. digitalWrite(IRpin, HIGH);
312. digitalWrite(IRpin, LOW);
321. digitalWrite(IRpin, LOW);
Change these lines to the opposition (LOW to HIGH and HIGH to LOW) like this:
310. digitalWrite(IRpin, LOW);
312. digitalWrite(IRpin, HIGH);
321. digitalWrite(IRpin, HIGH);
I think this should work, since now the led is by default connected to Vcc, so ESP8266 can boot normally. Let me know if it works, and if does, I may write an article on Wiki, because this could help others too.
from irremoteesp8266.
hey mark.
yes, now they boots up perfectly... but the ir-led is always "bright"
edit: but hey - they works.
from irremoteesp8266.
hm could you try this simple sketch:
void setup() {
pinMode(0, OUTPUT);
digitalWrite(0, HIGH);
}
void loop() {
delay(1000);
}
Change 0 to 2 if you are using that pin. This should leave your led turned off. Now change from digitalWrite(0, HIGH) to digitalWrite(0,LOW), and run it. It should turn on the led and keep it that way.
Is it doing this? You can use a normal led instead of the IR led to test it. The important thing is, to use the previous setup: connect the led to the pin and to Vcc.
from irremoteesp8266.
void setup() {
pinMode(2, OUTPUT);
digitalWrite(2, HIGH);
}
void loop() {
delay(1000);
}
= dark LED
void setup() {
pinMode(2, OUTPUT);
digitalWrite(2, LOW);
}
void loop() {
delay(1000);
}
= bright LED
VCC connected to LED+, GPIO2 on LED-
from irremoteesp8266.
This is exactly the expected behavior. Now if you edited the library correctly, it should set the pin HIGH in the end of the transmission, thus it should be dark.
Are you sure you are editing the code of the library which is used by the arduino IDE? Try to make some obvious mistakes, like write a non-existing command in the library, save it, and then try to compile some code in the IDE using the library. It should throw an error message.
Maybe you have to restart the IDE to recognize the changed library, but for me I don't have to do that.
from irremoteesp8266.
set ...
void IRsend::mark(int time) {
// Sends an IR mark for the specified number of microseconds.
// The mark output is modulated at the PWM frequency.
long beginning = micros();
while(micros() - beginning < time){
digitalWrite(IRpin, LOW);
delayMicroseconds(halfPeriodicTime);
digitalWrite(IRpin, HIGH);
delayMicroseconds(halfPeriodicTime); //38 kHz -> T = 26.31 microsec (periodic time), half of it is 13
}
}
...to ...
void IRsend::mark(int time) {
// Sends an IR mark for the specified number of microseconds.
// The mark output is modulated at the PWM frequency.
long beginning = micros();
while(micros() - beginning < time){
digitalWrite(IRpin, xxx);
delayMicroseconds(halfPeriodicTime);
digitalWrite(IRpin, xxxx);
delayMicroseconds(halfPeriodicTime); //38 kHz -> T = 26.31 microsec (periodic time), half of it is 13
}
}
...and save the file gets errors in compiling
C:\Program Files (x86)\Arduino\libraries\IRremoteESP8266\IRremoteESP8266.cpp: In member function 'void IRsend::mark(int)':
C:\Program Files (x86)\Arduino\libraries\IRremoteESP8266\IRremoteESP8266.cpp:310:25: error: 'xxx' was not declared in this scope
digitalWrite(IRpin, xxx);
^
C:\Program Files (x86)\Arduino\libraries\IRremoteESP8266\IRremoteESP8266.cpp:312:25: error: 'xxxx' was not declared in this scope
digitalWrite(IRpin, xxxx);
^
Fehler beim Kompilieren.
so the IDE works correctly.
But hey.. sending IR codes still works.
if the code/library to be used in battery-powered devices, it would be better the LED would be off while "standbying"
from irremoteesp8266.
Well, if sending IR codes works, then you can simply turn of the led after sending with digitalWrite(2, HIGH).
Btw are you sure, that you also changed the library in the 321. line? It's in the function IRsend::space(int time) and it should be digitalWrite(IRpin, HIGH) for you (the default is LOW).
from irremoteesp8266.
okay, i will try 👍
thanks for help and quick response
yes, line 321 was also HIGH
from irremoteesp8266.
good day all,
i like to say thank you for this library creator and supporting members,
its decoding perfectly but ESP8266 Restarting, If receive continuous IR Signal ,
Iam using gpio13 to connect ir receiver(TSOP1738)
from irremoteesp8266.
you can use esp-01 without problems (GPIO 2 = irsend(2)). just change irinverter to true (irsend.cpp) and add the lines below in setup (.ino) and use vcc default for IRemiter.
void setup() {
pinMode(2, OUTPUT);
digitalWrite(2, HIGH);
}
from irremoteesp8266.
@bragasil Do you have a circuit diagram for your ESP-01 circuit that we can have so we can show ESP-01 users how to do this?
from irremoteesp8266.
If you use the code in the master branch (or any release after v2.3.2)
You can do what @bragasil suggested by using the library as normal, but use/change your code to:
IRsend irsend(2, true); // Use gpio 2 and invert the signal. i.e. Normally HIGH.
// See https://github.com/markszabo/IRremoteESP8266/blob/master/src/IRsend.cpp#L27 for more details.
from irremoteesp8266.
remembering that at the time of uploading the firmware the led should not be connected. Another issue is that if the infrared led is low power, it is not necessary to use a drive or even a resistor.
from irremoteesp8266.
Related Issues (20)
- Does this library support for OnePlus TV , realme TV and Mi TV remote. HOT 1
- Problem with Zanussi A/C HOT 7
- IRHaierAC160 light toggle only working every 2nd time
- Unable to include C libraries HOT 3
- How to get or find CarrierAc 32 bit protocol? HOT 1
- Common AC Control - Swing turn on HOT 1
- Toshiba AC Remote Control B Support HOT 1
- Feature Request: De'Longhi Pinguino PAC N82 ECO IR Protocol HOT 5
- DAIKIN IRHVAC Off Issue. HOT 1
- The implementation and declaration of some functions differs from the function call HOT 4
- Coolix protocol "fan only mode" sends "dry mode" command instead HOT 1
- Support for Carrier RG56CMI-WRAC1 HOT 1
- Got error messages in Arduino IDE v3.0.1(ESP32C3) something like timerAlarm or void gpio_intr() HOT 1
- making a ir hub HOT 1
- FUNIKI AC remote (85 bits) need to be supported!
- Support for 'quiet' mode in COOLIX protocol
- Using any other mode than "Cool" causes AC to turn off. HOT 6
- Solution to AC remote giving different data for same button pressed HOT 2
- timer-related functions in IRrecv.cpp need to be updated HOT 2
- [XIAO_ESP32C6] IRrecv.cpp:246:3: error: 'timerAlarmEnable' was not declared in this scope; did you mean 'timerAlarm'? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from irremoteesp8266.