Button problems

Hi I new here, but old at arduino coding. I’m doing a Fencing Scoring machine, with the code that I found in the tutorial (https://www.instructables.com/id/Arduino-Fencing-Scoring-Apparatus/) because it’s already made, with te timings and etc… But only one problem, the code is using “attachInterrupt”, My I made my pcb without this in mind, so my button is a normal push with “1” output when pressed, can anyone help change the code? I’m trying for hours but nothing happ.

So, what I need, this button is for changing the modes (weapons), I need something that can work with the ChangeMode and checkIfModeChanged , that’s what change the mode.

Thanks!

Code_Scoring.ino (14.9 KB)

But only one problem, the code is using “attachInterrupt”, My I made my pcb without this in mind, so my button is a normal push with “1” output when pressed

Which pin is your “button” sewn onto? The switch does NOT output a 1 when pressed. The switch either pulls a pin down to LOW or up to HIGH, depending on how it is wired.

How is your “button” sewn on? Why didn’t you use a switch, instead?

Hi, it's pin 21. My bad, I'm testing the buttons and wrote that, what i mean is HIGH, thanks.

I use I push button because I need to change modes, I cant use a switch.

I cant use a switch

A push button switch IS a switch. So is a toggle switch and a knife switch and a tilt switch.

If you were using a knife switch, you would not refer to it as a knife would you?

Now that you are familiar with circuit board design, designing a new one to go with the code you have, but don't understand, will be much easier.