@@ -19,7 +19,7 @@ public class Screen : ScreenBase
1919 private const int DataCommand = 23 ;
2020 private const int Reset = 18 ;
2121 private static Axp192 _power ;
22- private static byte _lumi ;
22+ private static int _lumi ;
2323 private static bool _isInitialized = false ;
2424
2525 /// <summary>
@@ -53,7 +53,7 @@ public Screen()
5353 /// <summary>
5454 /// Enables or disables the screen.
5555 /// </summary>
56- public static new bool Enabled
56+ public new static bool Enabled
5757 {
5858 get => IsEnabled ;
5959
@@ -68,16 +68,16 @@ public Screen()
6868 /// Sets or gets the screen luminosity.
6969 /// </summary>
7070 /// <remarks> On M5Stick, anything less than 20% will be fully black</remarks>
71- public static new byte LuminosityPercentage
71+ public new static int LuminosityPercentage
7272 {
7373 get => _lumi ;
7474
7575 set
7676 {
7777 // For M5Stick, values from 8 to 12 are working fine
7878 // 2.5 V = dark, 3.0 V full luminosity
79- _lumi = ( byte ) ( value > 100 ? 100 : _lumi ) ;
80- _power . LDO3OutputVoltage = ElectricPotential . FromVolts ( ( byte ) ( _lumi * 0.5 / 100.0 + 2.5 ) ) ;
79+ _lumi = value > 100 ? 100 : value ;
80+ _power . LDO3OutputVoltage = ElectricPotential . FromVolts ( _lumi * 0.5 / 100.0 + 2.5 ) ;
8181 }
8282 }
8383 }
0 commit comments