Basically, I took an introductory java class, and managed to google my way through writing most of this code. I started writing this in C because I thought it'd be just a quick and small code... nope. I don't feel like starting over and reading up on avr machine language so I'll just keep going with it and hopefully learn a bit more about C.
The main problem in my code is I don't know how to approach datatypes. What i want is 8 bit global binary values (like registers in machine language) that I can just give a hex value to and manipulate with bit-wise operators. Yet I get stuff like "invalid digit '8' in octal constant". I don't even know how there's an octal constant in my code. Can someone look at my code and fix the current problem? At least get me different kinds of errors, they're all pretty much data type errors. Almost as important, please explain what you did and why that works where what I wrote doesn't.
Also I declared/made a variable called 'x' and then there's a 'for' loop in the code that has something like '(x = 0; x == #; x++)'. Would this take the global variable in and use it in the loop, or would the loop create it's own version of x?
I don't even know how there's an octal constant in my code.
In C, numbers starting with a zero are octal constants.
eg.
int a = 123; // decimal 123
int b = 0123; // OCTAL 123
Also I declared/made a variable called 'x' and then there's a 'for' loop in the code that has something like '(x = 0; x == #; x++)'. Would this take the global variable in and use it in the loop, or would the loop create it's own version of x?
If you don't declare your own one (which this tiny snippet doesn't) it would take the global one (or an "x" from the enclosing block. But the question is better posed in actual C code not stuff like "x == #" which wouldn't even compile.
eg.
for (int x = 0; x < 10; x++) // uses the x in the for loop, which then ceases to exist
int x;
for (x = 0; x < 10; x++) // uses the x declared before the for loop