How to handle polling method in micro controllers.?
your problem lies within the delay() statements. 
You've got multiple options:


Stay with a main forever loop (while (1) {}), but poll the inputs more often, so you can send on your uart.
Switch to interrputs to handle either the input handling (the UART TX interrupt won't help you, you'll need to get an interrupt, when an input event occurs
on the other hand, you could set up an timer on the chip, to give you interrupts on 1000ms (or 100ms or wahtever) intervalls, so you can control the lights from the interrupt subroutine.
you could use RTOS and implement tasks, which does stuff like that under the hood