DerStrom8
Super Moderator
no thats just a chunk, and /*wait*/ is waiting to be replaced with a command....
prototypes? is that what a subroutine is? I moved it up, but the error followed it, and all that is before it is another similar bracket, and both brackets have corresponding brackets?
i trimmed that snip so it has only one sub and one main, could you set it up just to get this first sub goin, just so i can template the rest? I updated the sample so there is only one sub and one main
Ok, one problem with that one is that you have a prototype within the main function. You need to put the prototypes before "main".
Anyway, I think you'll get the error "Error [1302] old style function declarations not supported" if you have a prototype but never call it. That might be your problem. Remember, to call the function by saying "functionName();" (It may look a little different if you're passing a value into it--you'll set it up like "functionName(input_value)".
Try putting in a line to call the function and get back to us then.
Oh, and yes, a function is basically the same as a subroutine. You set up the prototype (the program for the function) above "main" with the program you want to execute. You call it by putting the line (like what I mentioned earlier) into "main". It will look something like this:
/*prototype*/
void myFunction(void)
{
function code;
}
/*main function*/
void main(void)
{
myFunction();
}
Last edited: