какой выключатель? схема, скетч
грубо говоря кнопка
определена вот так:
//Кнопка
const int LeftButtonPin = 3; // the number of the pushbutton pin
const int RightButtonPin = 4; // the number of the pushbutton pin
int LeftButtonState = 0;
int RightButtonState = 0;
Подключена через замыкание gnd и указанного контакта