A few things:
I'm fairly certain modulus (%) works only on int... that could be causing some issues. (Though I think I see what you're doing (Trying to make this code execute once every 24 run-throughs) and that isn't the issue)
You most likely are having issues at this line:
Code:
*G = int(gyro->GetAngle());
I believe what you're doing here is creating a new pointer to an int (With the int()) and passing that into the value of *G. I think what you want to do is either remove the asterisk (assign the new pointer to G, not the value pointed to by G). You also need to remember to delete G each time. So you should end with something like this:
Code:
delete G;
G = int(gyro->GetAngle());
I believe the easier option is to remove the pointer-ness altogether. Direct access of data isn't bad.
That cout statement looks... very... very... very strange... and it's mere existance looks to be the issue...
Code:
cout<<("Gyroscope Angle: " && *G && "\n");
In 5-6 years of C++, I've never seen anything like that. (I've thought && was soley a boolean operator and couldn't be used on strings, especially in the way it is here.) I think you're trying to write something like this:
Code:
cout<<"Gyroscope Angle: "<<*G<<"\n";
Though I've noticed execution speed issues, formatting mishaps, with cout<<, and tend to use printf.
If *G is an int, then use this:
Code:
printf("Gyroscope Angle: %d\n", *G);
If *G is a double/float, replace the %d with %f.