Activating motor with Hall sensor

I've got a stepper motor which I want to turn on for 5 seconds once a hall sensor has sensed a magnet. I've tried multiple ways of getting timers to work but haven't been successful so far. I've attached my code. thanks


I've attached my code.

No, you've attached a picture of your code which is absolutely useless.

Read this: Read this before posting a programming question ...

Pay particular attention to Item #6 about the correct way to post your code with Code Tags.

Then, post your code correctly.

I would start by looking at the state change detect example, which shows how to see if a switch (which is what your sensor is*) has changed between open and closed.

*Although you should clarify if the hall sensor is an on/off digital one, or a ratiometric analog one.