I get error when try your code 6v6gt:
exit status 1
'val' was not declared in this scope
I tried declaring val before if and before setup or loop (as global?), but then led's do not blink (6v6gt version). And in my version, it does not help, the case still runs once, even with static. Maybe I did it wrong, correct me if that is.
int ledPin1 = 11;
int ledPin2 = 6;
int ledPin3 = 5;
static int val = 0; or static int val; or int val = 0; or int val;
void setup() {
...
Maybe I have to update it somehow differently?
And line endings are turned off.
Thank you for replies!