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