Wow Josh. I know you're frustrated, but come on. If you want to figure this stuff out, keep a clear head and try to focus!
For now, I'd recommend NOT using attachInterrupt(). Interrupts are a somewhat advanced feature. If you don't need them, spare yourself the grief of making your project more complex than it needs to be.
So that leaves us with "void", on your list of stuff not understood (msg #62).
All programming involves a certain amount of special syntax. You can spend a tremendous amount of time trying to learn every last detail, but that's very deep pit to jump into. Sometimes it's more effective to just accept the language has some arcane stuff and run with the examples.
But specifically about "void", programs are composed of functions. Arduino sketches always have at least 2 of them, called setup() and loop(). Functions are usually written with the parens "()", whereas other stuff isn't, so when you look at some code, the words that are functions can be seen by looking for the parens.
The setup() and loop() functions do not receive any data input and they generate no data output. Other functions can. The word "void" before the function name means it does NOT output (or "return") any data. The lack of any stuff between the parens "()" means it doesn't receive any input from the rest of the program. It's just a block of code that does something, without specifically getting any input or generating any output.
If you're just getting started, you're probably not about to go create a 3rd function, not to mention get the details right for it to receive inputs and return an output. Remember what I said about sometimes just running with existing examples. Well, if you did worry about such things, it'd look like this:
Code:
int myfunction(char a, int b) {
// my code
return 24; // or whatever number, maybe from a variable
}
This myfunction() gets 2 inputs, which are type char (a character) and int (an integer) and when it's done, it returns an integer to the rest of your program.
If you wanted to get those 2 inputs, but not return anything back, you'd write it like this:
Code:
void myfunction(char a, int b) {
// my code
}
The word "void" means the function will NOT give any return data.
These details are important when you write more complex code. In your program, you used digitalWrite() and digitalRead(). Both take inputs. The digitalRead() returns data, which is how it tells you what the pin actually was. The digitalWrite() has a return type of "void", because it doesn't give you anything back.
So, that's what "void" means. Hopefully this helps, at least with this specific question.
Somehow, you're going to have to manage to deal with using this unfamiliar stuff. If you do enough, you'll learn as you go. There are a LOT of these little arcane details. You can ask questions here, and there's a lot of good resources online and also in many good books. But ultimately, you're going to have to somehow emotionally manage how to make progress without getting so overwhelmed. Keep focused on your goals, and good luck!