 	}
 }
 extern "C" int main(void){	
+	CORE_PIN33_CONFIG = 0;  // completely disables the pin
+
 	Serial.begin(115200);
 	pinMode(LED, OUTPUT);
 

		// we're facing forwards
		frontSum = slave1.lightArray.armFrontSum;
		backSum  = slave1.lightArray.armBackSum;
		rightSum = slave1.lightArray.armFrontSum;
		leftSum  = slave1.lightArray.armBackSum;
	}
	else if (bearing > 45 && bearing <= 135){
		// facing right
		rightSum = slave1.lightArray.armFrontSum;
		leftSum  = slave1.lightArray.armBackSum;
		backSum  = slave1.lightArray.armFrontSum;
		frontSum = slave1.lightArray.armBackSum;
	}
	else if (bearing < -45  && bearing >= -135){
		// facing left
		leftSum = slave1.lightArray.armFrontSum;
		rightSum  = slave1.lightArray.armBackSum;
		frontSum = slave1.lightArray.armFrontSum;
		backSum  = slave1.lightArray.armBackSum;
	}
	else{
		// facing back
		backSum   = slave1.lightArray.armFrontSum;
		frontSum = slave1.lightArray.armBackSum;
		leftSum   = slave1.lightArray.armFrontSum;
		rightSum = slave1.lightArray.armBackSum;
	}

	if (frontSum) lightByte = lightByte | INDEX1;
	if (backSum)  lightByte = lightByte | INDEX2;
	if (rightSum) lightByte = lightByte | INDEX3;
	if (leftSum)  lightByte = lightByte | INDEX4;
	
	Serial.println(lightByte, BIN);
	switch (lightByte){
		case 0: /*nothing*/ 
			break;

	    		case SLAVE1_COMMANDS::CALIB_MAG:
	    			calibMagRequest(); // note that for this command another END_CALIB_MAG command must be sent to finish
	    			break;
	    		case SLAVE1_COMMANDS::CALIB_GREEN:
	    			slave1.lightArray.calibGreen();
	    			break;
	    		case SLAVE1_COMMANDS::CALIB_WHITE:
	    			slave1.lightArray.calibWhite();
	    			break;
	    		case SLAVE1_COMMANDS::END_CALIB_LIGHT:
	    			slave1.lightArray.endCalib();
	    			break;
	    		case SLAVE1_COMMANDS::LIGHT_DATA:
	    			slave1.sendPacket(slave1.lightArray.lightData, 16);
	    			break;
	    		case SLAVE1_COMMANDS::LIGHT_DATA_REFS:
	    			slave1.sendPacket(slave1.lightArray.refData, 16);
	    			break;
	    		case SLAVE1_COMMANDS::LIGHT_DATA_COLOURS:
	    			slave1.sendPacket(slave1.lightArray.colours, 16);
	    			break;
	    		case SLAVE1_COMMANDS::LIGHT_DATA_GREEN:
	    			slave1.sendPacket(slave1.lightArray.green, 16);
	    			break;
	    		case SLAVE1_COMMANDS::LIGHT_DATA_WHITE:
	    			slave1.sendPacket(slave1.lightArray.white, 16);
	    			break;
	    		case 255:
	    			break;
	    		default:
