Control a motor with flex sensor