Giter Site home page Giter Site logo

Pinout about irremoteesp8266 HOT 22 CLOSED

crankyoldgit avatar crankyoldgit commented on July 19, 2024
Pinout

from irremoteesp8266.

Comments (22)

markszabo avatar markszabo commented on July 19, 2024

To GND by default

from irremoteesp8266.

mocheffendi avatar mocheffendi commented on July 19, 2024

When we put LED IR to GPIO0 ESP 8266 ESP 12E always at programming mode, can I change to another GPIO ?

from irremoteesp8266.

markszabo avatar markszabo commented on July 19, 2024

Sure, just use eg. irsend(1) instead of irsend(0) and connect your ir led to GPIO1

from irremoteesp8266.

xCite1986 avatar xCite1986 commented on July 19, 2024

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.

mocheffendi avatar mocheffendi commented on July 19, 2024

Use irsend(5) to use gpio05

from irremoteesp8266.

xCite1986 avatar xCite1986 commented on July 19, 2024

from irremoteesp8266.

mocheffendi avatar mocheffendi commented on July 19, 2024

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.

Atzingen avatar Atzingen commented on July 19, 2024

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.

xCite1986 avatar xCite1986 commented on July 19, 2024

thanks for the hint :)

i would try this solution first
images

if this won't work i'll try to get out another gpio directly from the chip.
images 1

from irremoteesp8266.

markszabo avatar markszabo commented on July 19, 2024

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.

xCite1986 avatar xCite1986 commented on July 19, 2024

hey mark.

yes, now they boots up perfectly... but the ir-led is always "bright"

edit: but hey - they works.

from irremoteesp8266.

markszabo avatar markszabo commented on July 19, 2024

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.

xCite1986 avatar xCite1986 commented on July 19, 2024

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.

markszabo avatar markszabo commented on July 19, 2024

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.

xCite1986 avatar xCite1986 commented on July 19, 2024

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.

markszabo avatar markszabo commented on July 19, 2024

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.

xCite1986 avatar xCite1986 commented on July 19, 2024

okay, i will try 👍

thanks for help and quick response

yes, line 321 was also HIGH

2016-01-26_20-34-42

from irremoteesp8266.

rajasekarsarangapani avatar rajasekarsarangapani commented on July 19, 2024

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)

iam using samsung TV remote
page1
page2

from irremoteesp8266.

bragasil avatar bragasil commented on July 19, 2024

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.

crankyoldgit avatar crankyoldgit commented on July 19, 2024

@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.

crankyoldgit avatar crankyoldgit commented on July 19, 2024

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.

bragasil avatar bragasil commented on July 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.