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
Devices
Sensor
Accelerometer 3-Axis MMA7455
Test MMA7455.c
1
/*
2
Test MMA7455.c
3
4
Test the Parallax MMA7455L 3 Axis Accelerometer module.
5
6
http://learn.parallax.com/propeller-c-simple-devices/mma7455-three-axis-accelerometer
7
*/
8
9
#include "simpletools.h"
// Include simpletools header
10
#include "mma7455.h"
// Include mma7455 header
11
12
short
x, y, z;
// Axis variables
13
14
int
main
()
// Main function
15
{
16
17
MMA7455_init(7, 8, 6);
// I/O to: DATA, CLK, /CS
18
19
while
(1)
// Main loop
20
{
21
22
MMA7455_getxyz10(&x, &y, &z);
// Get acceleration measurements
23
print(
"%c x=%d, y=%d, z=%d %c"
,
// Display measurements
24
HOME, x, y, z, CLREOL);
25
26
pause(200);
// Wait 200 ms before repeat
27
}
28
}
29
main
int main(void)
Definition:
GraphicsTest.c:20
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12