Can I count a pulse on an output pin?

nickwoodrow

New Member
evening all!
I know how to use the count function to count and display each time a button is pressed. Is ther a simple code to count the pulse on an output pin?I am using a relay on output 7 to complete a circuit that fires the shutter on my camera. I am using a relay because I do not went to send any current down the lead into the camera. I hope this is correct (i have tested this for a thousand shots and every thing is ok -Nikon dslr .

If it is not possible with code, could I wire output 6 to another relay (or even take a pair of wires from pin 7 relay and attach them to an input! Would I damage the board or even your minds!? Once again sorry for my lack of what seems to be pretty basic noobie lack of electronic sense question. Thanks in advance. I am learning and suspecting I don't need a relay to complete a circuit for the camera, I suspect there is a more elegant way. :). Picaxe 28 axe020
 

Paix

Senior Member
I'll leave the counting to others that can better answer your question there, but as far as there being another way than relay contacts to trigger your camera. a 4N25, or similar, optoisolator would do the job. The input side of the 4N25 is a LED, so regular rules apply there. The output side is a transistor and can probably be connected across the camera trigger terminals in the same way as the relay contacts at present. There is obviously a positive and negative terminal from the camera and the positive goes to the opto isolator collector and the other to the emitter.

You may wish to include a small current limiting resistor, but if you currently only use relay contacts, then I think that you will find that any current limiting is already built into the camera, This technique is regularly used to key amateur radio transmitters via a microphone Press To Talk switch input.

If you look at the COUNT option in manual #2, then this may go some way to satisfying your original question, hopefully all the way.
 

eclectic

Moderator
@nickwoodrow.

Is this query related to Netserver?

Or is it a "normal" query?

Please let us know, and if needed,
it can be moved.

e
 

hippy

Technical Support
Staff member
[ Thread moved to Active Forum ]

It is possible to count pulses generated by the PICAXE but the question would be; why is that necessary ?

If the PICAXE is generating pulses it can keep count of the pulses it has generated. Every time the relay is activated, increment a count held in a variable.
 
Top