Giter Club home page Giter Club logo

Comments (8)

 avatar commented on May 21, 2024

check the hardware, to see if these pins are connected to GND or VCC

from nodemcu-firmware.

gorec2005 avatar gorec2005 commented on May 21, 2024

I have check
2 GPIO14
8 GPIO0
9 GPIO2
work for output (i connect to this pin's reley module with optocoupler) well...

from nodemcu-firmware.

ra3vld avatar ra3vld commented on May 21, 2024

At me after executing gpio.read(pin) (when it set to output ), this pin set to a high level.

from nodemcu-firmware.

goran-mahovlic avatar goran-mahovlic commented on May 21, 2024

I tried to write on all pins, and 5 6 7 are resetting module, those pin coud be connected to VCC
I have module 01 and applied ugly patch so may be that I did something wrong
here is the list of working pin (sets pin HIGH LOW with software, didi not check it with diodes)
http://pastebin.com/DsFFyxsG
I can confirm that pin10 - GPIO4 is working with diode
here is my working sample to change diode state thrue the telnet so you can write similar sample other samples I did find on internet did not work
http://www.lemilica.com/esp8266-wifi-modul/
If someone can test other pins on diferent modules it woud be great
Here is blink led sample thatI used with removed 5 6 7 pins
http://pastebin.com/vDA7HNs1

from nodemcu-firmware.

Scott--R avatar Scott--R commented on May 21, 2024

My apologies if I'm posting incorrectly. I'm new to Git, programming, and well, everything involving this chip actually. A week ago I knew nothing about HTML, LUA, etc and today I know little more.
I have been working with GPIO2 (pin 9), and setting to output is no problem, and writing to it is no problem. I have created PHT pages that nicely control GPIO2 output using the web server code. However, I have noticed that when I read the port using a command like print(gpio.read(9)), or any command that includes reading the port gpio.read(9) it will return the correct value, but then immediately set the output to LOW.

from nodemcu-firmware.

JamesNewton avatar JamesNewton commented on May 21, 2024

I don't understand why you would want to read a pin that is set as an
output. If it's an output, then you are controlling it's level from the
program. E.g. if you set it as an output and high, then why read it? You
know it's going to be high! If you set it as output low, you know its low.
Outputs are not read. Inputs are read.

Now this part I'm not sure about, but I would guess that when you do a
read, the chip is "thinking" "He is reading this pin, he must want to use
it as an input now, I'll change it from output to input and then read the
value on the pin". So you are seeing a low after read because it is now an
input, not because the output value was changed.

Again, the real issue is: What are you trying to accomplish by reading an
output pin?

On Fri, Dec 12, 2014 at 7:29 AM, Scott--R [email protected] wrote:

My apologies if I'm posting incorrectly. I'm new to Git, programming, and
well, everything involving this chip actually. A week ago I knew nothing
about HTML, LUA, etc and today I know little more.
I have been working with GPIO2 (pin 9), and setting to output is no
problem, and writing to it is no problem. I have created PHT pages that
nicely control GPIO2 output using the web server code. However, I have
noticed that when I read the port using a command like print(gpio.read(9)),
or any command that includes reading the port gpio.read(9) it will return
the correct value, but then immediately set the output to LOW.

β€”
Reply to this email directly or view it on GitHub
#10 (comment)
.

James Newton
MassMind.org http://www.MassMind.org
1-970-462-7764

from nodemcu-firmware.

Scott--R avatar Scott--R commented on May 21, 2024

Thanks James. The purpose for the port read is to invert the output from its current state. So, for example, I have a section of code that checks the current status of the output. If it is currently high, then change it to low. If it is currently low, change it to high. I could do this by creating a status variable I suppose, and then check that variable instead of reading the GPIO directly. And you may be correct on the whole "change output to input" thing as well. Thanks for the feedback. This is quite the challenge - I have to learn HTTP, encryption, HTML, PHT, LUA, and probably a bunch of other stuff I haven't even discovered yet to get all of this working. But it's FUN! I've got a bunch of the latest modules on the way over to play with.

from nodemcu-firmware.

JamesNewton avatar JamesNewton commented on May 21, 2024

Ah. Google "read modify write problem" for more on why a status variable
(aka shadow register) is a good idea.
On Dec 12, 2014 10:07 AM, "Scott--R" [email protected] wrote:

Thanks James. The purpose for the port read is to invert the output from
its current state. So, for example, I have a section of code that checks
the current status of the output. If it is currently high, then change it
to low. If it is currently low, change it to high. I could do this by
creating a status variable I suppose, and then check that variable instead
of reading the GPIO directly. And you may be correct on the whole "change
output to input" thing as well. Thanks for the feedback. This is quite the
challenge - I have to learn HTTP, encryption, HTML, PHT, LUA, and probably
a bunch of other stuff I haven't even discovered yet to get all of this
working. But it's FUN! I've got a bunch of the latest modules on the way
over to play with.

β€”
Reply to this email directly or view it on GitHub
#10 (comment)
.

from nodemcu-firmware.

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.