HI having strange issues with GPIO pins going high 30sec longer than GPIO4
I have 3 cube cells and it is doing it on all of them
I have connected up a button to use with a led. I connect the button to GPIO4, it stays low until i press the button then it goes high straight away(perfect exactly what I want). But if I connect it up to GPIO1,2,4 or 5 it goes high for 30 sec then goes low. Or just randomly come on by its self.
Any ideas?
works fine on the Heltec wireless stick light.
#include “LoRaWan_APP.h”
#include “Arduino.h”
#define buttonPin GPIO5
#define ledPin GPIO2 // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonState == HIGH) {
Serial.println(“HiGH”);
digitalWrite(ledPin, HIGH);
} else {
// turn LED off:
digitalWrite(ledPin, LOW);
Serial.println(“LOW”);
}
}