Hello
There are a bunch of basic programming errors in this code snippet.
May be you need a refresher course in ANSI C programming.
First issue:
The Prototype for function init must be ended with a ";" character. It should look like
void init(void);
Second issue:
The for instruction in function main is not correct.
You cannot define the loop counter i inside of the for loop.
So you need to define i as a local variable at the beginning of the main function.
Then the for should probably look as follows:
for ( i = 0; i < NUMREADINGS; i++)
Third issue:
You ended the function bmp right after
if (period > OFFTIME)
{
average = 0;
index = 0;
}
That means the code afterward is not located in any function. Which is invalid in ANSI C.
I stopped checking the source code at that point.....
CrasyCat