PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
propsideworkspace
Learn
Examples
Circuits
Count Transitions.c
1
/*
2
Count Transitions.c
3
4
Flash P26 at 10 Hz for 10 seconds. After 1 s, count transitions for 1 s
5
and report the count.
6
7
http://learn.parallax.com/propeller-c-tutorials
8
*/
9
10
#include "simpletools.h"
// Include simpletools
11
12
int
main
()
// main function
13
{
14
square_wave(26, 0, 10);
// P26, ch0, 10 Hz.
15
pause(1000);
// Pause 1 second
16
17
int
cycles = count(26, 1000);
// Count for 1 second
18
print(
"cycles = %d\n"
, cycles);
// Report on/off cycles
19
20
// Negative pin clears signal and lets go of I/O pin.
21
square_wave(-26, 0, 0);
22
}
23
main
int main(void)
Definition:
GraphicsTest.c:20
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12