HELP with building an ice fishing simulator

Anybody in this forum that can help me code a dc motor do turn on and off using random but no delay?(millis)

further on i would like to read a max val from the flex sensor from the point where the dc motor is on.

anybody??? please reply asap

Kind regards

Please improve your title as everybody wants help (almost OK)

wrt your question, I do not understand what your project is about. Can you elaborate on it?

Hi again Rob!

Thank you so much for prompt reply!

The thing is! I´m trying to build an icefishing simulator. Sounds weird and it is.

I have a dc motor inside my fish that has an offset weight into it. The "fishingline" is my electrical wires and goes from the dc trough my fishingrod and into my arduino.

Inside the fishingrod i´ve placed placed a flex sensor that is also hooked to my arduino board.

The story goes like this....

You´re sitting and fishing and raise your rod up and down like normally when you go icefishing.

Suddenly you get a fish snatching on your hook(the snatch is done by rotating the dc motor, but i need my snatches to be random without delay! (as the fish itself, you never know when it bites)

I made it like this. If you pull your fishingrod at the same second/seconds at a mapped strenght in the flexsensor,(which is inside the rod) you get you fish hooked properly. Like hooking a real fish.

When the given value in the flexsensor(when you´ve pulled in the rod at the right time) the dc will spin continously --> now the fish is properly on your hook and it´s wrigling.

A servo is opening a little hole in the ice after a few seconds and then the "fish" is yours.

Shortened down I actually need my flexsensor to react to the dc, which i can´t do with a delay in the loop.

Hope this is better...

Kind regards

Jonas

Much better, I changed your title to reflect the topic.
thank you

I'm not following how that's all going to work, but for delays (random or not) while avoiding the delay() function which pauses your program can be done using the methods in [u]Blink Without Delay Example[/u] and described in the post at the top of the forum that's titled, [u]Demonstration code for several things at the same time[/u].

....I've got an application where I've got 2 or 3 timers running at the same time.