working code for thumper(serial control)