Author Topic: Access information from accelerometer and clear flash memory  (Read 154 times)


  • Newbie
  • *
  • Posts: 4
    • View Profile
Hi guys,

I have two small questions, of which I do not seem to find an answer in the documentation.

1) If I understand it correctly, the accelerometer would allow me to find out whether a module is placed horizontally or vertically.  Via which variable(s) can I access this information in the scripting language?

2) If I understand it correctly, you can test code by pressing "run" in the McStudio environment, after which the code is run on the module's RAM which is cleared as soon as the power from the module is removed.  If I build and load the code onto the module, it is placed in the flash memory of the module permanently (and is also kept when the power is put off and on again).  How can you remove this code from the flash memory again afterwards?

Thanks for your response!

Kind regards,


Share on Facebook Share on Twitter


  • Global Moderator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
1) You have to communicate with the accelerometer over I2C. First read the datasheet for the module how to do this.
2) Correct you debug in RAM and if you are done you load in flash. If you load a new program in flash the previous one is overwritten. This is done by clearing the pages first and then load the new program. There is no separated clear function.