hi i just created an auto reel stop for a japan slot machine using an aurdino r3 along with a 4 channel relay, the problem i am having is that the relays click on and off even when the reel spin knob is not touched, can anyone help here with this if needed i can provide you my software program, thanks marcUse code tags to format code for the forum//japanese pachislot autostop mod:
//mcrowell75 and Atlanticom 2021:
//This code was written for an arduino nano and a 4 channel relay module:
//It has been tested on an IGT "Popper King" pachislo:
int button_1 = 2;
int button_2 = 3;
int button_3 = 4;
int spin_in = 5;
int spin_out = 6;
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
//japanese pachislot autostop mod:
//mcrowell75 and Atlanticom 2021:
//This code was written for an arduino nano and a 4 channel relay module:
//It has been tested on an IGT "Popper King" pachislo:
int button_1 = 2;
int button_2 = 3;
int button_3 = 4;
int spin_in = 5;
int spin_out = 6;
I'm not in a position to give you more than a quick answer but I believe you can find your solution here:
In short I suspect you don't have pull up resistors and you need to understand the difference between detecting when a button is pressed and detecting when it becomes pressed.
Please, STOP POSTING THE CODE AS PLAIN TEXT!
Now edit your posts, select the code and use the button shown on post #2 from @ruilviana and save it. Don't add new posts until you did that.
Thank you.
@rodneyfreilich Until you post your code as outlined in post #2, we have no faith you're comprehending anything else being asked of you. It's that simple. If you post as requested, people can then copy your code to their IDE and test/modify in order to help you.
As it is, it seems you're in such a hurry to get a solution, you can't be bothered to provide the necessary information for anyone to begin to provide you with a solution.
I've linked you to a tutorial that explains what input pullup does, see post #9. When you've read it, if you come back with questions that show you've read it then I or someone will clarify. As it is, others have commented about you not doing as they ask or providing basic information so until that happens I will leave you to your project.
There's no need to be a sofware genius to understand what we're asking you to do, to be compliant with the forum rules and kinda "netiquette", Keep ignoring those requests, and we'll keep ignoring yours. Have a nice day.