Automatically adjust screen brightness software and source code according to the surrounding environment