Comments (8)
check the hardware, to see if these pins are connected to GND or VCC
from nodemcu-firmware.
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.
At me after executing gpio.read(pin) (when it set to output ), this pin set to a high level.
from nodemcu-firmware.
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.
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.
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.
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.
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)
- ESP32: Cannot send files to device HOT 1
- ESP32: Not enough memory to load library HOT 1
- ESP32: dev-branch doesn't build out of the box
- Typo in docs/modules/spi.md
- Release version issue snprintf
- Lua httpserver duplicates status line HOT 1
- enduser resets any connection to http port
- Error during build: "as: unrecognized option '--text-section-literals'" HOT 3
- Add support for BMP390 sensor
- Flashing on ESP32-C2 not working HOT 5
- Add the rotary module to the ESP32 version
- Integer overflow (leading to stack-based buffer overflow) in embedded lua_struct.c HOT 2
- Here is a negation overflow in lua HOT 2
- Support the RGB LED used on the ESP32-C3-DevKitM-1
- Add support for matrix keypads to ESP32
- Making the lua component more standalone
- MQTT connect failure callback reason constants
- πESP8266 attempt to index global 'softuart' (a nil value)
- add module βRDA5807Mβ
- PR#3646 broke the 'file upload' function in ESPlorer HOT 20
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 nodemcu-firmware.