Mapping run time

Currently I am trying to build a robotic variable vibrator to go inside a beehive.

Any ideas on how to add the ability to Map Run Time from 0 -5 seconds based of analog input reading.

I was thinking of using IF a button is pushed run for map read= time.

Below is my current sketch.

bee_current.ino (4.37 KB)