H-bridge code tested and functional