Thread: another newbie
View Single Post
  #12   Spotlight this post!  
Unread 05-07-2004, 19:52
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: another newbie

Quote:
Originally Posted by dumbo
I would like to do it with a microcontroller.
Iam looking at buying the mirochip flash starter kit
to LEARN how too. if that would be a good choice?
I did look at some of the stuff on the FLASH starter kit. It appears that you do program it in C. I couldn't find the documentation on actual programming things such as output/input, so you're on your own there, but the outline I gave you above should help. (I hope)

Also, not sure on exactly what might be required in programs for it, but if you're lucky, you might just be about to have one file like this:

In the file called pir.c (just as an example, it could be anything)
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;
}
Quote:
Originally Posted by dumbo
I know this is real simple stuff for the people on this forum
Iam just a old man trying to stay with the times
Well, simple might be an exageration...

And, yes, for all you forum police out there, I am aware I duplicated some of that code... Don't bug me about it.
__________________