I need to blink an led at an adjustable rate (up and down buttons)
When micro switch input go's high momentarily than blink at the set rate until micro switch go's high again than stop.
blink should be adjustable to once a second to once every 60 seconds with a one second on time..
there will need to be an LCD interface that will display the current setting (Adafruit RGB LCD Shield)
PaulS:
Do you want someone to do this for you? Or, do you want to learn how to do it?
Reading the state of a switch is trivial. Comparing the current state to the previous state is trivial. The state change detection example shows how.
Blinking an LED is trivial. The blink without delay example shows how to do, and still read the switch state in a timely fashion.
Writing to the LCD is easy. The various libraries, for the various LCDs, show how.
What is missing from your requirements is HOW the off time is to be changed. That is needs to be changed is apparent. HOW it is to be changed is not.
So basically I would like the ability to adjust the blink time to once a second, once every two seconds, once every three seconds.....all the way to once every 60 seconds. This could be set or adjusted at any time during operation.
I would like to learn how to do this but I only have two weeks to develop this and I would have trouble learning so quickly. I fugured I would be better off trying to pay someone to do it.
I could get most of it accept the adjustable pulse rate.. I've had trouble getting thorough explanations on the forum. It's either people making me feel stupid or people writing stuff for me. I want to learn.
There are tons of learning materials on this website and other places so I will work with those until I am good enough but this has a bit of a timeframe.
mumbleelbmum:
I've had trouble getting thorough explanations on the forum. It's either people making me feel stupid or people writing stuff for me. I want to learn.
It's an anonymous forum - so get out of that mindset.
How is it different if people write stuff for you, for free, evidently vs. you paying for it being written for you, vis-a-vis "learning"?
I should add that you should log in and stay with it, see if you can't start a dialog and keep on till your situation is resolved.
ive always had to modify sketches that people have written for me on the forum. It's my fault because I'm not exactly clear in what I need my projects to do. So that is my fault. I'm a beginner, so when I have to add or modify than I get confused or mixed up so my project never gets finished.
I could do this.. But it would take a lot of time. I work a full time job and my wife is 8 months pregnant. Hahah you can imagine that I'm a bit preoccupied.
That's why I would opt to paying someone to do this. I really don't want to...
Its actually going to be used in a water treatment system. We have a chemical pump that requires a pulse to dose chlorine into a filtration system. The filter controllers provide a pulse output based on flow wile they are running so that the water passing through them is treated. once every hour or so they go into what's called back wash, where they rinse themselves out of all the contaminants and sediment collected. For some reason the pulse output stops wile in this phase and untreated water is used to rinse the media inside witch could cause problems.
what I want to implement is a piece of equipment that will read when the filters are in backwash (A micro switch that is triggered momentarily on the filters actuated valve head) and output a controllable pulse rate that can be adjusted through a lcd interface and up and down buttons.
I have managed to control the chemical pump with my uno. So it really can just be written to blink an led. As for the micro switch... A general debouching time can be implemented and I could adjust as needed.
Like I said the biggest issue I would hav is the adjustable pulse rate...
I don't know why that's a big deal if you can handle all the rest as you've said.
I guess it's always "on" for 1 second with a variable "off" time. So, you're changing the "off" time.
When? Does the current period get interrupted and it starts all over again with the new value.
It might speed you toward your objective and meet your deadline, if that's what's important, to use DIP switches (6).
They could be read (each as a binary element, 63 seconds max) at the beginning of each cycle and you wouldn't need millis() either.
That is correct. A variable off time is what's needed. when device is powered on, there will be no output pulses it will just wait for indication that the filters are in the backwash, than start pulsing at an adjustable rate.. until indication that the filters are finished with backwashing. In this case the "indication" is a no voltage contact that closes and opens once at the beginning of backwash and again at the end of back wash. once its over than the device will lay dormant again until it receives another indication for BW.
What if the BW is finished and there is (a lot of) time left?
Could it wait till the end of the longest period?
Is it just a user adjusting the time?
Are DIPswitches abhorrent to you?
If back wash is over than stop output pulses. Then wait unti it receives input indication again which woul mean back was was initiated once again. I believe backwash happens once a day at different times so it will have to just read the inputs from the switch that is triggered mechanically. It happens once at the beginning of backwash and once at the end. And I don't know what a dip switch is.
Assuming you have none.
So, you can read the state of a switch on this "shield" of yours?
I think the "shield", at this stage, would be a hassle.
With a DIPswitch, it's easy to set the switches, read them, and effect a result.
You see them, you set them, no LCD needed. You could work up to that later.
If you have 6 SPST switches ("mini toggle") then you could use those instead.
OK, I'll continue to monitor the channel (as so to say) for further developments.
Like I mentioned, using toggle switches will accomplish the same thing - and more readily manipulated (less "frustration.")
"Inputs"? One was mentioned.
Say it activates with 30 seconds selected and the activation goes away during the offtime then the input won't be checked again until the cycle completes. But it should be off anyway, so it shouldn't matter. If the activation goes away during the one second ontime, will that matter?
Didn't you say that this activation is a twice a day occurrence?
How long is an activation from this external switch (beginning / ending 'backwash')?
How long is this cycling period typically?
Is it a click on and back off that starts this and then, later, another click on and back off that ends it? Or is it "on" and the beginning and "off" at the end (or vice versa)?
I may require you to sketch the signaling, states and times (durations).
And I haven't asked about this chlorination switch and how you're interfacing with that. Is it an isolated contact closure, does it open/close to Gnd or what exactly?
Right now, if you put pin 2 to +5 and connect pins 11 and 12 to Gnd then pin 13 LED will go on for one second and then be off for 15 secs, repeating
It is not retriggerable during a timing cycle.