Method for detecting the slope of solar panels