// Testing Swiches on EduBase V2 /* On EduBase V2, SW5 is connected to A7 (analog) pin * and SW4 is connected to A6 * and LED0 to pin 2 and LED1 to pin 3 * This program reads the status of SW4 and places on LED1*/ const int LED1 = 3; /* on EduBase V2, LED1 connected to Pin 3*/ const int SW4 = A6; /* on EduBase V2, SW4 is connected to pin A6*/ int mySW = 0; /* mySW status*/ void setup() { /* configure input output pins for switch and LED */ pinMode(LED1, OUTPUT); pinMode(SW4, INPUT); } void loop() { /* read switch and use the value to set LED */ mySW=analogRead(SW4); if (mySW==0) digitalWrite(LED1, 0); else digitalWrite(LED1, 1); }