Shunxin 8 months ago
parent
commit
d15f14b885
1 changed files with 6 additions and 6 deletions
  1. 6 6
      libs/foo/__init__.py

+ 6 - 6
libs/foo/__init__.py

@@ -28,7 +28,7 @@ class foo(object):
         self.__led_pin_button.init(mode=Pin.OUT)
         self.__button.init(mode=Pin.IN)
         self.__timer = Timer()
-        self.__timer.init(mode=Timer.PERIODIC;period = 200,callback= self.__bliink_handler)
+        self.__timer.init(mode=Timer.PERIODIC,period = 200,callback= self.__blink_handler)
         self.__button.irq(handler=self.__int_handler,hard=True,trigger=Pin.IRQ_FALLING)
         
     ##############################             Property            ##############################
@@ -53,8 +53,8 @@ class foo(object):
         else:
             return pin
 
-def __blink_handler(self,timer):
-    self.__led_pin_timer.toggle()
-    
-def __int_handler(self,pin):
-    self.__led_pin_button.toggle()
+    def __blink_handler(self,timer):
+        self.__led_pin_timer.toggle()
+        
+    def __int_handler(self,pin):
+        self.__led_pin_button.toggle()