These are chat archives for esp8266/Arduino

31st
Mar 2017
wuweixin
@wuwx
Mar 31 2017 05:25
dos wificlient-datasource branch works fine ?
Jared A. Scheel
@jscheel
Mar 31 2017 05:47
Hi all, I'm having trouble writing a simple sketch that repeatedly blinks the led when a switch is pressed. Here is my sketch: https://gist.github.com/jscheel/25475e39cf9b522e12f4fd695b798a9e
when I press the switch, the led stays on, instead of blinking
wuweixin
@wuwx
Mar 31 2017 05:48
how about change the delay time * 10
1500 and 1000
100ms is fast in human 's eye
Jared A. Scheel
@jscheel
Mar 31 2017 05:50
@wuwx just blinking 150ms on and 100ms off works fine when I’m not also polling the switch
Martin Sloup
@arcao
Mar 31 2017 05:51
Do you have pull-up resistor on SWITCH_PIN?
Jared A. Scheel
@jscheel
Mar 31 2017 05:52
@arcao I’m setting the internal pull-up resistor (line 7). At least, I think this pin has an internal pull-up...
Martin Sloup
@arcao
Mar 31 2017 05:52
Sorry. I am a little blind at morning. :)
Jared A. Scheel
@jscheel
Mar 31 2017 05:53
np!
Jared A. Scheel
@jscheel
Mar 31 2017 06:02
it’s like the digital read stops everything else
here I created a blink using millis, instead of delay
same thing
Jared A. Scheel
@jscheel
Mar 31 2017 06:10
there’s also a good chance I am wiring this wrong
Dj
@m3rkiejr
Mar 31 2017 06:14
any suggestions on a good place to ask questions about wiring issues? I've got a simple, but odd problem i can't figure out..
Jared A. Scheel
@jscheel
Mar 31 2017 06:28
I have no idea what I’m doing, but here is how I have this wired for the sketch above
Screen Shot 2017-03-31 at 1.27.53 AM.png
with the internal pullup activated on the gpio pin
I don’t think I’m wiring this right
don’t I need to feed the 3.3v into the switch too?
Dj
@m3rkiejr
Mar 31 2017 06:37
I think the black should go to 3.3, should go from 3.3 to switch, then red to D0 and the pullup resistor to ground off the red side of the switch, as i understand it
but i'm just starting out.. so take that with a grain of salt
Jared A. Scheel
@jscheel
Mar 31 2017 07:09
oh, I think the gpio pin I am using has a special function
wuweixin
@wuwx
Mar 31 2017 08:26
oh, i know now
d0 not pin 0
try SWTICH_PIN = D0
Martin Sloup
@arcao
Mar 31 2017 08:41
OMG
Steve Nelson
@zenmanenergy
Mar 31 2017 16:04
has anyone here used timum-viw socket.io-client with node.js? I'm able to connect and receive events from my node server, but the emit method in the arduino ode doesnt' seem to send anything
Jared A. Scheel
@jscheel
Mar 31 2017 16:14
@wuwx hah, thanks, I moved it to the gpio pin labelled D1, which translated to SWITCH_PIN = 5. I’m not sure I understand the mapping between pins, gpio numbers, and these indexes. And I didn’t know there were contants for them either :)
Michael Miller
@Makuna
Mar 31 2017 17:24
Working with ESPs boards, the biggest issue I see is with the pin mappings ;-) Generally, GPIO5 is the same as just 5. But D5 is not! BUT, yes, there are constants you can use.