another newbie

I know you hate to see this another dum newbie.
I am very interested learning to do simple programs. I have a back ground in motor controls with some PLC logic. I have some simple programs that I would like to do to replace relay logic. looking at the microchip flash starter kit
for 8 and 14 pin chips. Is this a place that I can get some help. if not then I will just go away. :confused:

We never hate to see another “dum” newbie. We all practice gracious professionalism to its fullest extent on these boards. Anyway, I am no programmer but these boards deal with the FIRST robotics competition which uses the C programming language. A good amount of PBASIC help may be available as well. Chances are someone here will know the answers to your questions, but that person is not me.

Hey! Glad to see you’re interested. Are you in FIRST (just curious)? Regardless, here are my reccomendations:

(1) If you don’t know anything about programming, you shouldn’t start with embedded (embedded meaning low level circuit-y stuff) projects. Start with BASIC on a PC or perhaps html and javascript.

(2) If you DO know something about programming, but nothing about embedded programming you have two routes.

(2.1) Take the hard (but really cheap) road and start out with PIC microcontrollers.

(2.2) Get a BASIC Stamp from parrallax

IM me with questions: etherkill :wink:

I must disagree with Phrontist on point (1). If you are unfamiliar with programming, do not start with BASIC or web scripting. Start with a good book focusing on fundamentals and take a look at something like C++ or Java. Of cousre, if you are the type that loses interest easily and can’t live without quick results, Phrontist is right.

I definately wouldn’t suggest C++ as a starter language, I’d say Java or Python.

They’re actually very similar and for a new comer, I think, equally easy to learn. Personaly opinion, of course.

Oh, yeah. I’m always happy to answer ‘newbie’ questions. It feeds my ego to be able to give answers to people who don’t know something. :smiley: :wink:


What kind of relay-logic circuits are you looking to replace? If your circuits are simple enough, a good FPGA will suffice. They are not very hard to program, I have used a program called WinCUPL with them. I have only worked for a short time with them, but they sure beat using arrays of gates.

Also, I will suggest you take a look at Circuitmaker. It is a very useful tool for people working/learning/messing around with electronics. There is a student version of Circuitmaker 6 available for free on the Microcode website. There is also a trial version of Circuitmaker 2000 available (30 days only). I have used both the student version of Circuitmaker 6 and the full version of Circuitmaker 2000, and there aren’t many differences between them.

PM me or IM me if you need any help and Good luck.

ok here is what I need to do.
this operates a camera using a pir motion.
when the pir is tripped it has a output for 4sec. (adjustable)
what I need to do is
when the pir trips I need
1 output to stay on for 20sec (adjustable) from the time the pir trips then off
1 output to turn on 4 sec. (adjustable) after the pir trips and stay on for 4sec. (adjustable).then off.
if the pir trips again dearing this cycle. it has no effect.

I don’t know exactly what you are using to do this/what language you are using/etc, but the basic logic for this would look something like this:

Loop forever
    Check if pir tripped
        If it was, then
            Turn Output on and wait 20sec
            Turn Output on and wait 4sec
        End of tripped situation
    End check
End of loop

The 20 and 4 could be variables which are settable in some way.

That help?

Looks like this is in C, so, slightly more detail:

#define TRIPPED 1 // Whatever the "tripped" setting for the pir reads in the program

    if(pir == TRIPPED)
         // Turn on outputs and wait approriate times.
         // I'm not sure how'd you do this using your specific stuff.

thanks Texan
that the thing
I can do it with relays and 555 timer
I can do it with plc logic.
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 know this is real simple stuff for the people on this forum
Iam just a old man trying to stay with the times :ahh:

It’s real simple to us because it comes premade. You, however, do not have that luxery.

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. :slight_smile: (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)

// 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
         // Turn on outputs and wait approriate times.
         // I'm not sure how'd you do this using your specific stuff.
  return 1;

Well, simple might be an exageration… :smiley:

And, yes, for all you forum police out there, I am aware I duplicated some of that code… :rolleyes: Don’t bug me about it. :wink:

In the macro, wouldn’t you want to use a C style comment? I think it compiles as:

      if(pir_in == 1 // In place of the pir_in == 1 here, you would put)

Correct me if I’m wrong.

Thanks again you must be bored to help some one like me.
ok you now know were Iam coming form and were Iam going.
what would you think would be easyest,cheapest, best way to get there,
the pic kit was just something I saw. I am very much open for ideals

astrouth that my problem everything I do is homemade not premade


Not bored at all, we enjoy doing stuff like this. That’s one reason why we have this board, cuz we like being n3rds. :smiley:

Yeah, you’re right. The preprocessor won’t handle (well, most cheaper ones don’t) the comment and will insert it into the statement. The best solution would just be to put the comment above the #define. :slight_smile:

this may not be the place for me. who are you today :yikes: