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