Go Down

Topic: arduino waterdrop (Read 5896 times) previous topic - next topic

PaulS

Mixing delay() and millis() stuff is a recipe for disaster. Use one or the other.
The art of getting good answers lies in asking good questions.

whitehedr

Here is a link to a device that does what you want.  The code is available.  http://www.cameraaxe.com/wiki/index.php?title=Programming.  This device uses a different display module but you should be able to get info on how he did his timing.  This is a versatile little box.

RWW

whitehedr

Here is a link to my water drop controller project.  This is Uno based with a DFRobot Display shield and a protoshield that houses the solenoid driver chip.  This controller does not time the flash duration.  I use another device that is 555 timer based.  I bought it several years ago.  I lost the documentation for this box in a disk crash.  The Arduino controller just controls the size of the drops, the timing between the drops, and how many drops (1-3).  I built the controller because I was frustrated with the manual drop delivery of the 555 timer box. (eyedropper thru a IR interrupter.)   The Arduino generates the drops and triggers the flash delay timer.  Works pretty well.

http://arduino.cc/forum/index.php/topic,63036.0.html

RWW

PeterH

That looks pretty cool, good work.

I can't see quite what the problem is. It flashes three LEDs in sequence each time you push the button. Are you saying that the LED flash length is supposed to vary as you change the 'Time' parameter and it isn't varying?

Latas

thank you all for the replyes. yes that was exacly what was happening. the leds represent the valves so the delay shold varry. i have found the problem. iwas using the contant int instead of the int. now it works and i can change the valiues.the  only problem now is that the delay on the buttons seems to be interfering with the valve times.

for example.ifi use 1000ms drops all with 0ms timing,  they shold all turn on and off at the same time. but they dont. red turnes just a few ms beffor the yellow and the yellow a little beffor the green. must be the delay for the buttons? how cani remove them?

regards

PeterH

Haven't studied your code but from a quick glance it seems to use delay() to manage the timing. That means that once you've started that delay you can't do anything else until it ends.

If you want to be able to turn LEDs and/or valves on and off concurrently, you need to use the 'blink without delay' style approach to allow the script to keep running while you're waiting for time to pass.

Latas

thanks for the help. i dont know how to use millis verry well. is it possible to change just a little part of my code for the menus and buttons to millis?

just need the start so ican pick up on.

regards

Latas

Hi.

Here is the System as it stands. Its ready to mount in box.



My problem with the delays still stands. Just cant figure it out :(

Thanks in advance for anny help you can give me :)

Regards

Go Up