@@ -57,7 +57,9 @@ def tone(pin: Pin, frequency: float, duration: int = 1, length: float = 100) ->
57
57
try :
58
58
# pin with PWM
59
59
# pylint: disable=no-member
60
- with pwmio .PWMOut (pin , frequency = int (frequency ), variable_frequency = False ) as pwm :
60
+ with pwmio .PWMOut (
61
+ pin , frequency = int (frequency ), variable_frequency = False
62
+ ) as pwm :
61
63
pwm .duty_cycle = 0x8000
62
64
time .sleep (duration )
63
65
# pylint: enable=no-member
@@ -94,7 +96,9 @@ def bitWrite(x: int, n: int, b: int) -> int: # pylint: disable-msg=invalid-name
94
96
95
97
96
98
def shift_in (
97
- data_pin : digitalio .DigitalInOut , clock : digitalio .DigitalInOut , msb_first : bool = True
99
+ data_pin : digitalio .DigitalInOut ,
100
+ clock : digitalio .DigitalInOut ,
101
+ msb_first : bool = True ,
98
102
) -> int :
99
103
"""
100
104
Shifts in a byte of data one bit at a time. Starts from either the LSB or
@@ -237,11 +241,13 @@ def value(self) -> Any:
237
241
return self .iopin .value
238
242
239
243
@value .setter
240
- def value (self , value : Any ) -> None : # pylint: disable-msg =no-self-use, unused-argument
244
+ def value (self , value : Any ) -> None : # pylint: disable=no-self-use, unused-argument
241
245
raise AttributeError ("Cannot set the value on a digital input." )
242
246
243
247
244
- def map_range (x : float , in_min : float , in_max : float , out_min : float , out_max : float ) -> float :
248
+ def map_range (
249
+ x : float , in_min : float , in_max : float , out_min : float , out_max : float
250
+ ) -> float :
245
251
"""
246
252
Maps a number from one range to another.
247
253
Note: This implementation handles values < in_min differently than arduino's map function does.
0 commit comments