Quote:
|
Originally Posted by Texan
Code:
// Here you could put in any '#include's which are required for input/output
// You'll have to find a manual to tell you what to do exactly
// Example: #include <example.h>
#define PIR_IS_TRIPPED pir_in == 1 // In place of the pir_in == 1 here, you would put
// whatever you need to do to determine if the pir is tripped
int main(int argc, char **argv) // What this is exactly depends somewhat on the compiler
// For instance, it might just be int main(void), instead
{
while(1)
{
if(PIR_IS_TRIPPED)
{
// Turn on outputs and wait approriate times.
// I'm not sure how'd you do this using your specific stuff.
}
}
return 1;
}
|
In the macro, wouldn't you want to use a C style comment? I think it compiles as:
Code:
//...
if(pir_in == 1 // In place of the pir_in == 1 here, you would put)
//...
Correct me if I'm wrong.