PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Examples
C Intro
Functions
Function Call.c
1
/*
2
Function Call.c
3
4
Send a simple hello message to the console, but use a function to display
5
one of the messages.
6
7
http://learn.parallax.com/propeller-c-functions/reusable-code-functions
8
*/
9
10
#include "
simpletools.h
"
// Include simpletools
11
12
void
hello(
void
);
// Function prototype
13
14
int
main
()
// main function
15
{
16
hello();
// Call hello function
17
print
(
"Hello again from main!\n"
);
// Display message
18
}
19
20
void
hello(
void
)
// Hello function
21
{
22
print
(
"Hello from function!\n"
);
// Display hello message
23
pause
(500);
// Pause 1/2 second
24
}
pause
void pause(int time)
Delay cog from moving on to the next statement for a certain length of time.
Definition:
libws2812.c:125
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
print
int print(const char *format,...) __attribute__((format(printf
Print format "..." args to the default simple terminal device. The output is limited to 256 bytes.
main
int main(void)
Definition:
GraphicsTest.c:20
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17