put setup routines for gpio and twitter inside functions. catch exceptions in functions that query twitter.