Compass project failure once disconnected from PC

Thanks for doing that test, it looks like we can rule out memory problems for the time being.

that memory, if it was going to be an issue would be more at risk the longer the program ran.

No that is only when you have a memory leak, and that is not the case here.

Two points:-

  1. You seem to have no pull up resistors on the I2C bus. You do need them. Look here at the results of not having them.
    http://www.dsscircuits.com/index.php/articles/47-effects-of-varying-i2c-pull-up-resistors

  2. It could be that the first program is doing some initialization of your compass module that the second program is not doing. This would explain why you get it working when you load one followed by another, but on a power down this initialization is lost and therefore just having the second program will not work.