Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change pin mode in work? #9

Open
vvzvlad opened this issue Oct 13, 2016 · 1 comment
Open

Change pin mode in work? #9

vvzvlad opened this issue Oct 13, 2016 · 1 comment

Comments

@vvzvlad
Copy link

vvzvlad commented Oct 13, 2016

How do I do this using DirectIO?

pinMode(ESP_RESET_PIN, OUTPUT);
digitalWrite(ESP_RESET_PIN, LOW);
delay(50);
digitalWrite(ESP_RESET_PIN, HIGH);
delay(50);
pinMode(ESP_RESET_PIN, INPUT);
@mmarchetti
Copy link
Owner

DirectIO doesn't have a straightforward way to put outputs back into high-impedance mode. This is something that should be addressed (and I think would be straightforward).

You could leave the last pinMode call in place as long as you don't use the Output object again. Wrapping this in a function would prevent that:

void ESPReset(void)
{
    Output< ESP_RESET_PIN> pin;
    pin = LOW;
    delay(50);
    pin = HIGH;
    delay(50);
    pinMode(ESP_RESET_PIN, INPUT);
}

Alternatively, you could keep the code sequence you have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants