View Single Post
Posts: 219 | Thanked: 94 times | Joined on Nov 2009 @ Helsinki, Finland
#11
Originally Posted by phil128 View Post
The reason i don't really wanna code up an endless loop was due to a lecture slide from the stanford university where it states "don't use big loops, use timers etc" I assume due to its more efficient. At the same time i guess it i want to transmit data in real-time i guess i have no choice but to use and endless loop to cycle through reading from the proc filesystem(accelerometer) and transmit this over bluetooth.
If you want data in real-time, use the events that accelometer API provides. If you end up using timed queries to proc filesystem, find out whether there's an timer API that you can use to schedule execution, i.e. no need for loop.
__________________
Ham > Turkey