I am currently trying to design a small very basic trigger box to output a 5v pulse at different times, that are selectable by a switch. Currently I am having difficulty with getting one time to function correctly.
I have an LED flashing every 1 second when a switch applies 5v to digital pin 7.
My issue is, when 5v is removed from pin 7 the light still flashes, there is no voltage at all on this pin as I have measured it with a multimeter.
I am using a Arduino Nano Everyday
Any help appreciated ??
#define OneSec 7
int TTL1 = 2;
void setup() {
pinMode(TTL1, OUTPUT);
pinMode(OneSec, INPUT);
}
void loop() {
if(digitalRead(OneSec) == HIGH){
digitalWrite(TTL1, HIGH);
delay(100);
digitalWrite(TTL1, LOW);
delay(900);
}
}