scarybeard:
a lot of the stuff I'm missing is in comment caps:
...
//IF BUTTON IS PUSHED, (A0 goes high) ADD 10 POINTS
//IF BUTTON IS PUSHED, (A1 goes high) ADD 30 POINTS
}
Hi Scarybeard! Are you asking about how to increment the score values with your code?
As you mentioned that you are relatively new to coding, I have a couple of pointers that hopefully may help you.
First, may I suggest that you either use a variable to store your pin assignments in, or what I do is define a constant since those values don't change throughout your code's execution. This way, as your code grows, you have an easy way of keeping track of what pin goes to what and makes it much more human-readable not only to other people but yourself (you yourself will have a hard time remembering what the pin numbers are for a few weeks after writing the code, making it harder to revise). Also it means that should you need to change that pin for any reason as your project develops, you only need to change it in your code once as opposed to everywhere that that specific pin number appears in your code.
Here is an example of the method that I use, near the top of my sketch, I'll put something like
#define PIN_LED 13
#define PIN_SENSOR A1
and so on for all the pins I'm planning on using. You may find this to be a time saving practice and keep your code as organized as your wiring is (your wiring is very neat and easy to follow by the way, nice work)
Second,
to increment the value when a button is pressed, you'll need a couple things in your code where those comments are.
One thing you'll need is a conditional statement such as an
If statement (also, once you understand how to use a library, definitely look into the debounce solutions mentioned here by LarryD and OldSteve).
Another piece you'll need to have is an assignment statement like addition.
int a = 0;
int b = 0;
//addition example a
a = a + 5;
//addition example b
a += 5;
The example a takes the current value of a, adds 5, then stores the result in the variable a.
Example b in this case does the same thing, but uses a compound assignment operator += to accomplish the same task.
Well I hope this helps! Let us know how the project is going along, looks like you're well on your way to getting your scoreboard working! Keep going!
~Nichole