A light simulator for sensor network using Matlab and C++