H48C accelerometer code on ObEx, why run in new cog?
bulkhead
Posts: 405
I'm just wondering why the code in the ObEx for the Parallax H48C tri-axis accelerometer needs to run in its own cog. Any particular reason for this? I'm just checking because I need to free up a cog and it seems like the acc has no real reason for needing its own cog.
If I did modify the object to not run in its own cog, could I simply remove the last "JMP #H48C" line so that the assembly portion doesn't loop infinitely but terminates and goes back to my main program (wherever I "called" that method)? To use the modified object, I would have some method like "refreshValues" that would call the assembly routine to execute just once to update all of the variables.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm new to the propeller!
If I did modify the object to not run in its own cog, could I simply remove the last "JMP #H48C" line so that the assembly portion doesn't loop infinitely but terminates and goes back to my main program (wherever I "called" that method)? To use the modified object, I would have some method like "refreshValues" that would call the assembly routine to execute just once to update all of the variables.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm new to the propeller!
Comments