   return value;
 }
 
-CRGB selectColor(float heading)
+CRGB convertHeadingToColor(float heading)
 {
   int convertedHeading = map(heading, 0, 51, 0, 255);
   return CHSV(convertedHeading, 255, 180);
 }
 
 // monitor orientation for mode-change 'gestures'
-void CheckForGestures(sensors_event_t accel)
+void checkForGestures(sensors_event_t accel)
 {
   if (accel.acceleration.x < gestureThreshold)
   {

{
  // Read the magnetometer and determine the compass heading:
  lsm.getEvent(&accel, &mag, &gyro, &temp);

  CRGB color = selectColor(fabs(round(mag.magnetic.z * 100)));

  // Check for mode change commands
  CheckForGestures(accel);

  // apply a little frictional damping to keep things in control and prevent perpetual motion
  MomentumH *= friction;
  MomentumV *= friction;

long gestureStart = 0;
long gestureHoldTime = 3000;

int modeNumber = 0;

bool pendulum = true;
bool antiGravity = true;  // The pendulum will anti-gravitate to the top.
bool mirroredEyes = false; // The left eye will mirror the right.

