Build upon MMA7660_HelloWorld to pull out x, y, z axes from device and print to LCD on mbed Application Board

Dependencies:   C12832_lcd MMA7660 mbed

Fork of MMA7660_HelloWorld by Erik -

Here reside bits and pieces of coding that is mostly derivative of the work of others. Mostly extensions and other modifications.

The proprioception board project.

Board design images follow.

/media/uploads/chapfohn/260px-sphere-and-ring_balance_board_underside.jpg /media/uploads/chapfohn/obroc2.gif

/media/uploads/chapfohn/coolboard-balance-board-ultimate-package-medium-bot02-03-w450.png

Committer:
Sissors
Date:
Wed Oct 17 16:40:45 2012 +0000
Revision:
0:bd0546063b0a
Child:
1:0a7a84edc8e5
Hello World 1.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Sissors 0:bd0546063b0a 1 //Uses the measured z-acceleration to drive leds 2 and 3 of the mbed
Sissors 0:bd0546063b0a 2
Sissors 0:bd0546063b0a 3 #include "mbed.h"
Sissors 0:bd0546063b0a 4 #include "MMA7660.h"
Sissors 0:bd0546063b0a 5
Sissors 0:bd0546063b0a 6 MMA7660 MMA(p28, p27);
Sissors 0:bd0546063b0a 7
Sissors 0:bd0546063b0a 8 DigitalOut connectionLed(LED1);
Sissors 0:bd0546063b0a 9 PwmOut Zaxis_p(LED2);
Sissors 0:bd0546063b0a 10 PwmOut Zaxis_n(LED3);
Sissors 0:bd0546063b0a 11
Sissors 0:bd0546063b0a 12 int main() {
Sissors 0:bd0546063b0a 13 if (MMA.testConnection())
Sissors 0:bd0546063b0a 14 connectionLed = 1;
Sissors 0:bd0546063b0a 15
Sissors 0:bd0546063b0a 16 while(1) {
Sissors 0:bd0546063b0a 17 Zaxis_p = MMA.z();
Sissors 0:bd0546063b0a 18 Zaxis_n = -MMA.z();
Sissors 0:bd0546063b0a 19 }
Sissors 0:bd0546063b0a 20
Sissors 0:bd0546063b0a 21 }