@@ -190,7 +190,7 @@ def autoplay(self, delay=0, loops=0, frames=0):
190190 self ._register (_CONFIG_BANK , _AUTOPLAY2_REGISTER , delay % 64 )
191191 self ._mode (_AUTOPLAY_MODE | self ._frame )
192192
193- def fade (self , fade_in = None , fade_out = None , pause = 26 ):
193+ def fade (self , fade_in = None , fade_out = None , pause = 0 ):
194194 """
195195 Start and stop the fade feature. If both fade_in and fade_out are None (the
196196 default), the breath feature is used for fading. if fade_in is None, then
@@ -207,9 +207,13 @@ def fade(self, fade_in=None, fade_out=None, pause=26):
207207 fade_in = fade_out
208208 elif fade_out is None :
209209 fade_out = fade_in
210- fade_in = int (math .log (fade_in / 26 , 2 ))
211- fade_out = int (math .log (fade_out / 26 , 2 ))
212- pause = int (math .log (pause / 26 , 2 ))
210+
211+ if fade_in != 0 :
212+ fade_in = int (math .log (fade_in / 26 , 2 ))
213+ if fade_out != 0 :
214+ fade_out = int (math .log (fade_out / 26 , 2 ))
215+ if pause != 0 :
216+ pause = int (math .log (pause / 26 , 2 ))
213217 if not 0 <= fade_in <= 7 :
214218 raise ValueError ("Fade in out of range" )
215219 if not 0 <= fade_out <= 7 :
0 commit comments