PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Examples
C Intro
Functions
Global Exchange.c
1
/*
2
Global Exchange.c
3
4
Functions exchange information with global variables.
5
6
http://learn.parallax.com/propeller-c-functions/memory-functions-can-share
7
*/
8
9
#include "
simpletools.h
"
// Include simpletools
10
11
void
adder(
void
);
// Forward declaration
12
13
int
a, b, n;
// Global variables
14
15
int
main
()
// main function
16
{
17
a = 96;
// Set values of a & b
18
b = 32;
19
adder();
// Call adder function
20
print
(
"n = %d\n"
, n);
// Display result
21
}
22
23
void
adder(
void
)
// Adder, no parameters or return
24
{
25
n = a + b;
// Use values of a & b to set n
26
}
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