I have a Digispark Rev.3 Kickstarter with ATTiny85 (see pinout below) and a three pin slide switch (see example below). I want to use the slide switch to control a task running on the Digispark, with the example code below.
The center pin of the slide switch will be connected to GND, one pin will be soldered to pin 2 on the Digispark (pinMode(2, INPUT_PULLUP);
) and the remaining pin will be unused.
To install the switch, I want to have the center pin of the switch go through P3 on the pinout, one pin through P2 (which will be addressed in the code) and the remaining pin through P4. This means, P3 will be soldered to GND and depending on the switches position, P2 or P4 will connect to GND as well.
Could these connections between P2, P3 or P4 and GND interfere with the functionality or damage the Digispark?
int switchPos;
void setup() {
pinMode(2, INPUT_PULLUP);
}
void loop() {
switchPos = digitalRead(2);
if (sensorVal == HIGH) {
runCode();
} else {
delay(1000);
}
}