Python code: attempt to switch bank and write channel