Reorganized Arduino code.