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
Multicore
Cog Run Example.c
1
/*
2
Cog Run Example.c
3
4
Run function that blinks a light with another cog continuously.
5
6
http://learn.parallax.com/multicore-approaches/simple-multicore
7
*/
8
9
#include "simpletools.h"
// Library include
10
11
void
blink();
// Forward declaration
12
13
int
main
()
// Main function
14
{
15
cog_run(blink, 128);
// Run blink in other cog
16
}
17
18
void
blink()
// Blink function for other cog
19
{
20
while
(1)
// Endless loop for other cog
21
{
22
high(26);
// P26 LED on
23
pause(100);
// ...for 0.1 seconds
24
low(26);
// P26 LED off
25
pause(100);
// ...for 0.1 seconds
26
}
27
}
28
main
int main(void)
Definition:
GraphicsTest.c:20
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12