Added changing brightness for display_bar

Calculate the brightness by (level / 1023) * MAX_BRIGHTNESS, then bound between MAX_BRIGHTNESS and MIN_BRIGHTNESS.