/* Sample program to contron LEDs using push-button switches on Wytec EduBase board * The LEDs are connected to pins 3, 4, 19, 38 and the push-button switches are * connected to pins 23, 24, 25, 26. * DIP switches should be at off position because they share the same pins as * the push-button switches. */ /* Tiva TM4C123 */ //const int LED[] = {PB_0, PB_1, PB_2, PB_3}; const int LED[] = {3, 4, 19, 38}; /* Tiva TM4C123 */ //const int SW[] = {PD_0, PD_1, PD_2, PD_3}; const int SW[] = {23, 24, 25, 26}; void setup() { // configure input output pins for switches and LEDs for (int i = 0; i < 4; i++) { pinMode(LED[i], OUTPUT); pinMode(SW[i], INPUT); } } void loop() { // read switches and use the values to set LEDs for (int i = 0; i < 4; i++) { digitalWrite(LED[i], digitalRead(SW[i])); } }