Updated direction code to match wiring of pcb