My head hurts, and I need help with a project (noobie alert)...
I have 4 buttons, each button sets a different counter interval...
I press a button it turns on a lamp (110Vac), and depending on which counter it represents, the lamp stays on until a 5th button is pressed as many times is needed to turn off the lamp again.
When one of the 4 buttons is pressed, the other buttons are disabled until the count down is reached, turning off the lamp and reseting itself.
Does that make sense? Can someone help me with this (I am to the point of paying someone to sketch and build it for me... lol)
Welcome!
Five buttons, one lamp. I could sketch it, but.
wire your buttons from input pin to ground, and enable INPUT_PULLUP.
I hope your lamp is an LED. Presuming that, wire the LED ouputpin to LED+ , resistor LED- to GND.
With the above in mind, your five button pins will be LOW when read using digitalRead(pin).
Your LED will be ON when a HIGH is written to the digital output, using digitalWrite(pin,value).
That should be a good start, let us know what doesn't make sense, or better, post your first code attempt using that info.
Think of it like a game, and this is a first part.
Let's say I press Button 1 and it sets a counter to 100. I put someone on Button 5 and tell them to slap it as fast as they can until the light turns off.
I realize that I will need a 5V relay to switch the 110Vac Marquee on and off, instead of an LED and Resister.
Ultimately I would like to add more Slapping Buttons and Marquees for players to race each other. Picture me setting a Counter to 300, and 4 Drumpads where Drummers race to see who can turn their Lights off (or on saying Winner!) first.
I want to keep it simple until I understand the initial concepts.
I am using a CT 1.1 Counter Controller Module right now, but it offers no real expandability. I will upload a pic of the module that I am going by.
Yes, but I think I am getting confused by the difference between Counter and Timer. It seems that they are used as the same thing in some of the sketches I am seeing.
I will push one of the 4 buttons, and say, "you have 300 slaps to turn on/off your light"
The player will slap at the button 300 times until the light turns on/off.
I don't need a display or audible sound. I just want to have 4 preset counters to make it easy to change the counts.
Button 1 = 50 slaps
Button 2 = 100 slaps
Button 3 = 300 slaps
Button 4 = 500 slaps
Button 5 is the slap button
When first slap is detected on Button 5, Buttons 1-4 are disabled
There is a relay to turn on/off an external 110Vac Marquee flashing "Winner!" when the player reaches 300 slaps.
When I push a Button, the Relay for the Marquee switches on/off
(the Relay will need to be NO/NC SPDT where the coil is NC when energized)
When Button 5 is done, the game resets itself, turning on/off the Marquee Relay and re-enabling Buttons 1-4
Future Desires:
Button 6-8 added for more players to race
Those Buttons have their own Marquee Relays
I hope that I am making sense
Sorry, I am making this for my grand kids to play, to burn energy... lol
OK, well I am an old guy who's knowledge is stuck back in 386 DOS days... NT4 MCSE Certified and A+ Certified... Used to train and teach...
Got out the business in 2000 after Y2K brought down the entire planet... lol
I then moved to Mac and worked as a Web Developer, Photographer, Graphic designer and Video Editor for about 10 years....
When my health started to limit me, I started to be a tinkerer to keep my brain working.
I play with Raspberry PIs, Arcade Machines (I am currently working on a scratch built Jukebox, Jamma 60in1 Arcade, Slot machine, coin pushers, and carnival type games for children's church outreaches)... Oh and I am working on plans to build a HotDog Cart and Kettle Corn Popper...
I have a basic Arduino UNO R3 kit but this has been my biggest challenge and the weakest link in my tinkering experience... I understand the basics, but this is new to me and frankly my brain has me scratching my head... lol
I use arcade switches...
I have my hands in a lot of things, but I am starting to fee like a mumbling old man... lol
Oh and I cannot solder and like the breadboard building the Arduino offers... It reminds me of the old Radio Shack Electronic toy I had as a kid...
If you use an LCD display, you only need one switch to set the counter.
Each time this switch is pressed, it could cycle thru a list of values 50-500 which then sets the counter if the switch is held for longer than say 2 seconds.
The display would show the value that is currently in the counter.
What is supposed to trigger the user to start slapping switch #5 ?
With a SPDT Relay, I figure that one side would light the arcade button when ready to start, and light the marquee when count is reached (turning off the button).
I got about 75% of that diagram, but it looks like I could figure it out. Not sure what the Heartbeat LED is for...
It seems that if I went with the 1 Button/Display option, I would free up the 3 Buttons for 3 additional players..? Just copy/paste the commands for Button 1 changing the pins for the 3 new buttons?