Bingo! I want to write a program for LIS302DL(MEMS Accelerometer) by my self since I've bought STM32F4 Discovery. After few days of working and learning, I've just finish my programming few minutes ago and it is working perfectly well.
So, the program is written to keep the discovery board's surface level at zero, means if the surface is tilted on which the Board is placed, the led(s) will glow such that it indicate the direction at which the surface should be tilted to balance the level.
STM32F4 Discovery also came with the same program, but it is too complex to understand. In their Demo, TIMER4 is used. Instead of using timer I've used only simple led on-off command. It is too simple to understand then using timer.
Here are some photos:
It isn't possible for me to tilt the whole table. So, I just tilted the board!Bad PJ, isn't it?
So, the program is written to keep the discovery board's surface level at zero, means if the surface is tilted on which the Board is placed, the led(s) will glow such that it indicate the direction at which the surface should be tilted to balance the level.
STM32F4 Discovery also came with the same program, but it is too complex to understand. In their Demo, TIMER4 is used. Instead of using timer I've used only simple led on-off command. It is too simple to understand then using timer.
Here are some photos:
It isn't possible for me to tilt the whole table. So, I just tilted the board!Bad PJ, isn't it?
Here's the video of Acceleromter and STM32F4 in action:
The program used one special type of interrupt Sys_Tick. This interrupt generates at every 1ms in my program. You can change if you want. So, at every 1ms we check the resisters of LIS302DL and compare it with our logic to blink led according to the direction. I don't want to say that we should not use TIMx in programming, but what I mean is why to use complex programming method when the simplest form of programming is available. The main advantage of not using TIM4 is that the time require to handle TIM4 interrupt is saved in case of using simple GPIO On-Off command.
Wow!!! I was also trying to make an easier code but got no success..Can you share your code plz...
ReplyDeletesure...
DeleteI would like to share. Send me your email address.
can you share the code with me also ? i would really help me... if you can send the code to this email: modeliukax@gmail.com
Deletei need one, plz share it.
ReplyDeletetrandat.us09@gmail.com
This comment has been removed by the author.
ReplyDeleteplz share it!!
ReplyDeletemy email: phuc.ng25@gmail.com
thanks
You can send the code to this email: artem.peryev@gmail.com
ReplyDeleteThis comment has been removed by the author.
ReplyDeletehey, i have texas instruments ekk-lm4f232 eval board....it has arm cortex m4 processor....can u plz tell me where did u learn its programming?? need it urgently
ReplyDeleteemail me at prateekaroraeee@gmail.com
thnx
Hi Prateek
DeleteJust play around with example codes. Try to understand it. I am sure you'll learn a lot just by doing this.
Wow!!! I was also trying to make an easier code but got no success..Can you share your code
ReplyDeleteMy Email : phuoc166.nguyenhuu@gmail.com
tks u
Can you share code for me?
ReplyDeleteThank you!
tmtuan.23@gmail.com
Hi, good work!
ReplyDeleteI'm trying to make something like this for few days but I can't.
Could you email me your code please?
leo.guitarmg@gmail.com
Thanks!
Could you email me your code too?
ReplyDeletemartin.thuemmel@gmail.com
Thanks!
could you share your code with me too?
ReplyDeletekruzi@web.de
thanks a lot
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeletecould you send me the code please:
ReplyDeletesassi.insaf@gmail.com
I really need it: sassi.insaf@gmail.com
ReplyDeleteYour code, would be a great help for a beginner with this card(me), please email it to me! adam.mesterhazi@gmail.com
ReplyDeletecould you send me the code please:
ReplyDeleterenyu34@yahoo.com
could you send me the code please:
ReplyDeleteprzemek.rolka@gmail.com
can you send also to me please, ufukyumrukaya@gmail.com. thank you
ReplyDeleteIf you do not mind please send me also this program. I have to start to learn it and it will be a great model for me. This is my email: siczek@gmail.com. Thanks a lot.
ReplyDeleteHi there, i would love to get this code too. I'm struggling for a few days with this damn MEMS-Sensor.
ReplyDeleteMy E-Mail: bladeboarder1@hotmail.com
bonjour ; I happened to configure LIS302DL and showed me the measurements between 0 and 255 for the three axes. I can not know these values are between 0 and 255 which unit so that I can convert them after mm/s2 ??
ReplyDeletePlease if you do not understand the question let me know
ReplyDeleteHi Amina
DeleteRefer datasheet of LIS302DL. In mechanical specification on page no 10, the sensitivity is given as either 18 mg or 72 mg depending upon FS bit is set to 0 or 1 respectively.
The measurement values are in between 0 to 255. Suppose you read value 100. Now, if you've set FS bit to zero, multiply this reading by 18 i.e. 100*18 you'll get your answer 1800 mg. You can convert 'mg' into mm/s2 by multiplying it by 9.810 So, final answer will be 17658 mm/s2.
Hey I'm working on a project to expand on the use of the MEMS accel, can you send me your project code?
ReplyDeletee-mail: jacobryan90@gmail.com
Thank you.
Hey. Could you send me your project code?
ReplyDeletee-mail: pietrucha.piotrek@gmail.com
Thank you
Hi, could I have your project code too?
ReplyDeletee-mail: joytoefl120@gmail.com
Thank you.
can you send also to me please, rlkumar1977@gmail.com. thank you
ReplyDeleteHi,
ReplyDeletePlease share it.
Thanks a lot.
My e-mail: tha_akan91@hotmail.com
have a nice day...
Hi please share with me your code.
ReplyDeleteE-mail:buraksakaci@gmail.com
have a nice day
Hi
ReplyDeleteI've been struggling on this for a week. Can you please send it to me on a.patel@uct.ac.za
Thanks so much
Amir
I really need it: aresrepair@gmail.com
ReplyDeletehave a nice day
Hi please share with me your code.
ReplyDeleteE-mail:buraksakaci@gmail.com
have a nice day
to compile this source code, what software are you using?
ReplyDeletekeil.. probably..
DeleteHi,
ReplyDeleteI have downloaded the source code provided in the following link https://github.com/mitul93/STM32F4-Discovery-MEMS-interface
Built a Project project with code provide in STM32F4-Discovery_FW_V1.1.0 and replaced main.c,main.h,stm32f4xx_it.c and stm32f4xx_it.h.
Project build was successful but no Leds are building when i tilt the board. Is there any modification required in the code