I am trying to make the on board inertial sensor and I2C to communicate and blink LEDS based on xyz directions as RGB on a FRDM-KE02Z40M board. I didnot have a driver for the on board inertial sensor MMA8451Q on the IDE KDSV3.0 and PE and so I used the driver code for the sensor from the source link below.
The errors that I am getting is with regard to the definition of the struct on the device driver. (screenshot attached)
I am not sure why the object MMA8451_TDatastate is not being created or errors are thrown. Syntactically this looks okay to me. Any thoughts or suggestions are welcome. Thanks!
P.S.I have not used the GPIO_LDD component as mentioned in the link. I am not sure what its use case is.
There is a complete solution which samples the MMA8451Q and drives the LED color depending on its position. It can be simply modified to control LED blinking or other outputs as required.
Kinetis for professionals: http://www.utasker.com/kinetis.html
I am using Open SDA as my Debugger and PEComponets in KDS. Do you think I should change to uTasker now?
I have drivers for Accelerometer and Generic I2C installed in my Processor Expert Components (as Erich had uploaded on GitHub) . Now I have an error free code in KDS but there is only RED led on forever inspite of tilting the board. Any pointers to debug this issue would be helpful.
It is up to you. If you want to improve performance and development efficiency you can use the uTasker environment and also have an immediate solution to your present work.
It builds with KDS (or CW, or IAR, or Keil, Rowley, Atollic, CooCox, Green Hills, GCC, VS) and alows you to simulate to better debug and analyse Kinetis workings. It doesn't use PE since it has hand-crafted code for all of the functions that can be put together much faster than PE code generation, as well as allowing you to move between Kinetis parts without needing to generate new projects and port work that has already been done.
To check your board and the operation there is a binary at one of the links which you can load (quote):
ADC Sampling and LED color control using PWM based on Accelerometer Readings
This application has been configured with PWM support (SUPPORT_TIMER and SUPPORT_PWM_MODULE) with three PWM outputs connected to the three LEDs in the RGB LED (PWM_LED_CONTROL), which, together with the I2C based accelerometer operation, controls the intensity of the three LED colors in the RGB LED so that the LED's overall color depends on the orientation of the board.
ADC operation is enabled (SUPPORT_ADC) and with TEST_ADC enabled in ADC_Timers.h demonstrates regular sampling of the thermistor's positive terminal voltage, which is then displayed on the UART debug interface (115'200 Baud).
Since the LED is used by PWM outputs, the normal blinking green LED operation is not present.
uTaskerV1.4.011_FRDM-KE02Z40M_ADC_PWM_ACC.bin Stand-alone software that can be loaded using the FRDM-KE02Z40M's USB-MSD boot loader [25.9k].
PS: See this video (also valid for KDS) to see how easy it is to set up and build an application that uses the accelerometer to control a USB mouse: https://www.youtube.com/watch?v=uBbiw36Caq4&feature=youtu.be
Your processor doesn't have USB and that is why the LED color control is practical. Almost any Kinetis part can be used without any porting needed - just set 1..3 defines in the project code and 2 settings in whichever IDE you wish to use to achieve your first goal!