 void nunchukControlModeUpdate() {
 	nunchuk.update();
 	// the Z-Button disables nunchukcontrolmode
+	// but only if we didn't just enable it
+	//	i.e. it is still pressed from enabling the mode
 	if (nunchuk.zButton)
-		nunchukControlModeToggle();
+		if (!nunchukControlJustEntered && !nunchukControlJustExited)
+			nunchukControlModeToggle();
+	else  {
+		nunchukControlJustEntered = false;
+		nunchukControlJustExited = false;
+	}
 }
 
 void nunchukControlModeSendValues(void) {

// nunchuk
ArduinoNunchuk nunchuk = ArduinoNunchuk();
bool nunchukControlMode = false;

void nunchukControlModeToggle(void) {
	nunchukControlMode = !nunchukControlMode;
	if (nunchukControlMode) {
		sendMsgF(MSG_NCM_ON);
		messageScrollSet("nunchuk control on");
	} else {
		sendMsgF(MSG_NCM_OFF);
		messageScrollSet("nunchuk control off");
	}
	messageScrollUpdate(true);
}

		if (cycles == 0)
			messageScrollUpdate(true);
		cycles++;
		if (cycles == CYCLES_RESET_COUNT)
			cycles = 0;

		// if we are in the nunchuk control mode 
		// or once per CYCLES_RESET_COUNT cycles check for a Z-button press
		if (nunchukControlMode || cycles == 0)
			nunchukControlModeUpdate();
	}
}
