rem: (int)micro_controller_comm.local[i].magnitude<<endl<<endl;
context: void *write_thread(void *arg){	int i;		while(true)	{		for(i=1;i<NUMDEVICES;i++)		{						if(   (micro_controller_comm.local[i].mode      != micro_controller_comm.remote[i].mode ) 				|| (micro_controller_comm.local[i].magnitude != micro_controller_comm.remote[i].magnitude) ) 			{										if ( ! micro_controller_comm.remote[i].writable ) // if its not writable you have no business changing it... 					{                                 // putting it back the way it was							cout<<"Got new values for feedback device"<<i<<endl;							cout<<"mode="<<(int)micro_controller_comm.remote[i].mode<<"   magnitude="<<												(int)micro_controller_comm.remote[i].magnitude<<endl<<endl;							micro_controller_comm.local[i].mode      = micro_controller_comm.remote[i].mode;							micro_controller_comm.local[i].magnitude = micro_controller_comm.remote[i].magnitude;							micro_controller_comm.local[i].writable  = micro_controller_comm.remote[i].writable;					}					else					{							//cout<<"Difference detected in device "<<i<<endl;							//cout<<"Got     mode="<<(int)micro_controller_comm.remote[i].mode<<"\t  mag="<<													(int)micro_controller_comm.remote[i].magnitude<<endl;							//cout<<"Sending mode="<<(int)micro_controller_comm.local[i].mode<< "\t  mag="<<												(int)micro_controller_comm.local[i].magnitude<<endl<<endl;							epoch++; // Debugging variable to find out the rate of packet transmission														write_packet(i, micro_controller_comm.local[i].mode, 												 micro_controller_comm.local[i].magnitude);					}			}			else			{					//if(epoch > 0)					//	{					//	cout<<epoch<<" loops untill change registered"<<endl;					//	epoch= 0 ;					//	}			}		}						// some delay here	}}