Quantcast
Channel: Learn with BlocklyProp — Parallax Forums
Viewing all articles
Browse latest Browse all 293

Simple "count" question

$
0
0
long count	(	int 	pin,
long 	duration 
)		
Count number of low to high transitions an external input applies to an I/O pin over a certain period of time.

Parameters
pin	I/O pin number
duration	Amount of time the measurement counts transitions
Returns
The number of low to high transitions



This is out of the propeller.h manual.
Does anyone know the default units of "a certain period of time"?
I am assuming milliseconds, as most of the other examples of timing commands use milliseconds.

Suppose that pin 19 is already an input, and is being used elsewhere in the program. Would int t = count(19, 1000) and the other function of pin 19 be possible at the same time?

Viewing all articles
Browse latest Browse all 293

Trending Articles