Need Help With Dart Score Board Programming

Hey everyone,
I’m trying to figure out the program I need to write in order for this to work. I’m not so good at programming, but am in school for electronics. I have some code written already, but all it does is display a single number on a 3 digit 7 segment display when I press a key on the 4x4 keypad, on the Arduino Uno.
What I want the program to do is:
Display “501” when turned on
substract score from previous score when entered
and be able to reset
that kind of idea, any help would be appreciated, I;m not expecting someone to write the whole code for me !
Thanks.

My current code is attached

KeyPadSevSeg.ino (1.07 KB)

These questions may give you some ideas

Can you get the display to show a 3 digit number.

If you have a variable with a number in it (say 501) can you get that number to be displayed on the display by splitting it into its 3 separate digits?

Can you subtract a number from that number and display the new number?

When you have these things figured out it will be time to consider the keypad.

…R

Yes I have been able to display 501 on the 7 segs, but that's only when I have the value set. It's more so inferfacing the kepad and sev seg i'm having problems with. Thanks for the reply though!

You can display a number entered on the keypad so already have the basis of what you want to do.

Was the 501 that you displayed in a variable ? If so, you need to read a number from the keypad as it is entered until a termination character, perhaps # is received, then turn the digit(s) entered into a real number.

If you are prepared to enter leading zeros and always enter a 3 digit number this is easy. Multiply digit 1 by 100, multiply digit 2 by 10. Add the 2 results together and add digit 3. Subtract the result from the variable whose number is currently being displayed and display the result.

To restart the process, detect a key such as *, set the display variable to 501 , display it and start again.

There are neater ways to do the input part of this that don’t require leading zeroes and 3 digits but get it working first then improve it.

Next project. Add an LCD screen and calculate the best way of checking out given the current score :slight_smile:

Zack_Seguin: Yes I have been able to display 501 on the 7 segs, but that's only when I have the value set. It's more so inferfacing the kepad and sev seg i'm having problems with.

That was the first of my 3 questions.

Have you tried working through the other two questions in Reply #1? They are an essential pre-requisite to using a keypad.

...R

Hey guys, I understand what needs to be done in the code, I just dont know how to write the code, All I did with the code I have now is take bits of example code from the library's and mix them together. I can read code and get the jist of it , but I cant write.

Hey guys, I understand what needs to be done in the code, I just dont know how to write the code, All I did with the code I have now is take bits of example code from the library's and mix them together. I can read code and get the jist of it , but I cant write.

I'd suggest that you head over to Gigs and Collaboration, then, and try to hire someone. Here, we help people that try.

All I did with the code I have now is take bits of example code from the library's and mix them together. I can read code and get the jist of it , but I can`t write.

I doubt that the code you copied was actually in libraries but that aside you have obviously got some code that does parts, if not all, of what you want to do. Shall we check ?

Can you put a number in a variable and display the value of that variable on the display ? Can you read a single digit input on the keypad ? Can you multiply the single digit from the keypad by another number and save the result in a variable ? Can you read a non numeric input from the keypad and recognise that it is not a digit ? Given a number in a variable can you subtract another number from it and save the result in a variable ?

Many of these questions have been asked before but you have not answered them. As suggested, if you don't want to write the program yourself then Gigs and Collaborations is the place to ask someone to do it for you.

Zack_Seguin: Hey guys, I understand what needs to be done in the code, I just dont know how to write the code, All I did with the code I have now is take bits of example code from the library's and mix them together. I can read code and get the jist of it , but I cant write.

You may not be able to write a complete program today. But if you put your mind to it I have no doubt you will learn how over the next days and weeks. And, as @PauS has said, we will be happy to help.

...R