Skip to content

Instantly share code, notes, and snippets.

@turbo
Created August 17, 2018 15:53
Show Gist options
  • Save turbo/7c261ef3238ce8f24ed5214e46ea7508 to your computer and use it in GitHub Desktop.
Save turbo/7c261ef3238ce8f24ed5214e46ea7508 to your computer and use it in GitHub Desktop.
Use ESP8266 ESP-12F/E D1 Mini GPIO Pin 10
/*
* In ESP 12 modules, spec. D1 Mini mounted, GPIO9 and GPIO10 can sort of be freed up.
* GPIO9 is connected to flash HOLD
* GPIO10 is connected to flash WP
*
* In DIO mode, these pins should be free, but remain connected to the flash chip.
* Using GPIO9 will crash the module sooner or later, GPIO10 is relatively safe, but
* don't fuzz it. Might be good enough for SPI CS or similar, no data rates pl0x.
*/
bool enabled = false;
void setup(void) {
Serial.begin(115200);
enabled = ESP.getFlashChipSize() == FM_DIO;
if (!enabled) return;
pinMode(10, OUTPUT);
digitalWrite(10, LOW); // let's see if this'll brick it
}
void loop() {
if (!enabled) return;
Serial.println("Setting high.");
digitalWrite(10, HIGH);
delay(1000);
Serial.println("Setting low.");
digitalWrite(10, LOW);
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment