Pseudocode for LEDControl.c Lights up the LEDs that indicate being paired ( and the color depends on the DOG that you're paired with) DisplayDOGSelected Turns on the LED reflecting the DOG select switch that's on call GetDOGSelected function and use what's returned to save variable DOGSelectedForLED switch on DOGSelectedForLED case DOG_1 Turn DOG 1 LED on Turn DOG 2 LED off Turn DOG 3 LED off break case DOG_2 Turn DOG 1 LED off Turn DOG 2 LED on Turn DOG 3 LED off break case DOG_3 Turn DOG 1 LED off Turn DOG 2 LED off Turn DOG 3 LED on break default ( includes NO_DOG, where all LEDs should be off ) Turn DOG 1 LED off Turn DOG 2 LED off Turn DOG 3 LED off break end switch on DOGSelectedForLED end DisplayDOGSelected TurnLED Turns an LED on or off if controlling the Active communication LED if the command is to turn LED on turn the LED on by setting the pin else (the command is to turn the LED off) turn the LED off by clearing the pin end if else (controlling one of the DOG-selected indicator LEDs) if the command is to control DOG_1_LED Set LEDPinNumber equal to DOG_1_LED_PIN_NUMBER else if the command is to control DOG_2_LED Set LEDPinNumber equal to DOG_2_LED_PIN_NUMBER else if the command is to control DOG_3_LED Set LEDPinNumber equal to DOG_3_LED_PIN_NUMBER end if if the command is to turn LED on turn the LED on by setting the pin else (the command is to turn the LEDs off) turn the LED off by clearing the pin end if end if end TurnLED