/* Program to control LEDs using push-button switches on Wytec EduBase/EduPad board * with Tiva TM4C123/MSP432. * The LEDs are connected to pins 3, 4, 19, 38 and the push-button switches are * connected to pins 23, 24, 25, 26. * * Energia 1.6.10E18 */ const int LED[] = {3, 4, 19, 38}; 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])); } }