PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Monitor sound impact occurrences from another cog.
IMPORTANT: This library is only for making monitoring from another cog more convenient. Your application does not need this to check the sensor's output state. For that, all you need is:
int state = input(pin);
The value of pin should be Propeller I/O connected to sensor's SIG pin. The sensor returns a 1 to state if an impact is detected, or 0 if not.
More...
#include "simpletools.h"
Go to the source code of this file.
Functions | |
int * | soundImpact_run (int pin) |
Runs the sound impact tracking process in another cog. More... | |
void | soundImpact_end (int *processID) |
End sound impact tracking process and recovers cog and stack memory for other purposes. More... | |
int | soundImpact_getCount (void) |
Get number of impacts since last call to soundImpact_getCount. More... | |
Monitor sound impact occurrences from another cog.
IMPORTANT: This library is only for making monitoring from another cog more convenient. Your application does not need this to check the sensor's output state. For that, all you need is:
int state = input(pin);
The value of pin should be Propeller I/O connected to sensor's SIG pin. The sensor returns a 1 to state if an impact is detected, or 0 if not.
Definition in file soundimpact.h.
void soundImpact_end | ( | int * | processID | ) |
End sound impact tracking process and recovers cog and stack memory for other purposes.
processID | process identifier returned by soundImpact_run. |
Definition at line 26 of file soundimpact.c.
int soundImpact_getCount | ( | void | ) |
Get number of impacts since last call to soundImpact_getCount.
Definition at line 31 of file soundimpact.c.
int* soundImpact_run | ( | int | pin | ) |
Runs the sound impact tracking process in another cog.
pin | Propeller I/O pin connected to sound impact SIG pin. |
Definition at line 19 of file soundimpact.c.