MPU6050 Arduino Hang after a while

        COM1=1;

        if (COM1==1) {

That's dumb. About as dumb as not reading the stickies at the top of the forum, to learn how to post code properly. Snippets are NOT the way to post code.

    }}}

More dumb stuff. ONE curly brace per line.