working engine control code with flex sensors