code: function(port,type,mode){
  	//paratistic inheritance
  	//http://www.crockford.com/javascript/inheritance.html
  	var sensor = new Sensor(port,type,mode);
  	sensor.processData =function(counter,value){
  		if(counter != this.request_counter){
  			return
  		}
  		var payload = value.substr(10,2);
  
  		//if mode is light intensity, change the result to numeric value
  		if(this.mode == 0 || this.mode ==1 ){
  			payload = parseInt(payload,16);
  		}
  
  		for(i=0; i < this.callbacks.length ; i++){
  			this.callbacks[i](payload);
  		}
  	}
  
  	return sensor;
  }
docs: inherited sensors