flag style signals attached to switch machines

I was wondering if anyone has attached a working flag style signal to a switch opperated by atlas switch machines, and how it could be done. any ideas?