event counting
doggington
Posts: 2
Hi all
I have been useing the bs2 for· a while for simple machine control, with basic IF THEN· sort of programming. INPUTS· are generally from IR sensors and OUTPUTS· are to motors or solenoid valves. I have now got to the point of trying to control position by using a rotating threaded rod and an indexed plate with holes to to ·cause pulses in an IR sensor. the code I use is lifted from the stampworks manual (i think).
Code attached.
My problem is that whilst this code counts at slow speed, the shaft is rotating at the speed of a cordless drill motor without its gearbox this is too fast.
can anyone give me some code that will cope or tell me how fast I can make the shaft rotate without missing a pulse?
I have been useing the bs2 for· a while for simple machine control, with basic IF THEN· sort of programming. INPUTS· are generally from IR sensors and OUTPUTS· are to motors or solenoid valves. I have now got to the point of trying to control position by using a rotating threaded rod and an indexed plate with holes to to ·cause pulses in an IR sensor. the code I use is lifted from the stampworks manual (i think).
Code attached.
My problem is that whilst this code counts at slow speed, the shaft is rotating at the speed of a cordless drill motor without its gearbox this is too fast.
can anyone give me some code that will cope or tell me how fast I can make the shaft rotate without missing a pulse?
Comments
Welcome to the Parallax Forum
First········· You need to·define ALL of you·PINs with name which make it easier to follow your code
Second····· You need to put ALL CON at the top of your code
Third········· You need to put RETURN after ALL SUB Routine in your·code
Please look at attachment bellow
Please read through the What is a Micro-Controller this will help you a lot
······························· ^^^^click above ^^^^ on the line
Stamp Work······ page 98
·My problem is that whilst this code counts at slow speed, the shaft is rotating at the speed of a cordless drill motor without its gearbox this is too fast.· Yes ·this maybel· to fast to count
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 7/31/2009 11:20:24 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen