Accelerometer in KDS
This is a small project made in KDS using the accelerometer on a FRDM-KL25Z128M4 board.
The program outputs the 3D position of the board to a terminal, such as Tera Term at 9600 baud.
PWMs are also used, their intensity is dependent on the offset from the zero position.
The red LED intensity increases with X offset.
The blue LED intensity increases with Y offset.
Simply press any key to begin data output.
Sections of code taken from http://mcuoneclipse.com/2012/09/21/tutorial-accelerating-the-kl25z-freedom-board/
There seem to be 'dead zones' while the board is tilted towards a corner.
The terminal will not output anything while in a 'dead zone'.
There will be a constant flicker of the LED even when the board is flat.
This is due to the accelerometer occasionally outputting 1 even when the board is static.