-->
Page 1 of 1

GPIO Outputs

PostPosted: Mon Oct 19, 2015 1:06 am
by PaulLowman
I am using an Olimex Mod-WiFi-ESP8266-Dev module to control an anchor winch on my launch. It uses two gpio pins as outputs and I have allocated GPIO4 and GPIO5. The following code is used to set the mode but I have found that, although GPIO4 works fine connecting to GPIO5 causes the module to stop. The load is a 1K resistor to the base of a BC547 driving a relay. I see a voltage of 0V on GPIO5 and this does not change with digitalwrites to the pin.
I was wondering if using the FUNCTION_0 in addition to the pinMode(OUTPUT) is necessary but it did not improve matters.

Code: Select allpinMode(4, OUTPUT);
pinMode(5, OUTPUT);  // (also tried pinMode(5, OUTPUT | FUNCTION_0) )

Any clues folks?

Cheers

Re: GPIO Outputs

PostPosted: Mon Oct 19, 2015 2:41 pm
by Barnabybear
PaulLowman wrote:I am using an Olimex Mod-WiFi-ESP8266-Dev module to control an anchor winch on my launch. It uses two gpio pins as outputs and I have allocated GPIO4 and GPIO5. The following code is used to set the mode but I have found that, although GPIO4 works fine connecting to GPIO5 causes the module to stop. The load is a 1K resistor to the base of a BC547 driving a relay. I see a voltage of 0V on GPIO5 and this does not change with digitalwrites to the pin.
I was wondering if using the FUNCTION_0 in addition to the pinMode(OUTPUT) is necessary but it did not improve matters.

Code: Select allpinMode(4, OUTPUT);
pinMode(5, OUTPUT);  // (also tried pinMode(5, OUTPUT | FUNCTION_0) )

Any clues folks?

Cheers


GPIO 5 is incorrectly labled on some boards (possably older stock). Just set it high and check the other GPIOs untill you find one high.

Re: GPIO Outputs

PostPosted: Mon Oct 19, 2015 4:52 pm
by PaulLowman
Typical situation - try again in morning and all works perfectly. Hmmm.

Re: GPIO Outputs

PostPosted: Mon Oct 19, 2015 4:54 pm
by PaulLowman
As a matter of interest does anyone use the FUNCTION_x mask in the pinMode function?