| 12345678910111213141516171819202122232425262728293031323334 |
- # import mywifi
- from machine import Timer
- # import esp_mqtt
- import struct
- import os
- import time
- import re
- class Client():
- def __init__(self):
- self.count = 0
- self.timer = Timer(0)
- self.timer.init(period=2000, mode=Timer.PERIODIC, callback=self.push)
-
- def push(self, timer):
- self.count += 1
- print("Client:", self.count)
-
- class Test():
- def __init__(self) -> None:
- self.count = 0
- self.timer = Timer(0)
- self.timer.init(period=2000, mode=Timer.PERIODIC, callback=self.publish_timer_callback)
-
- def publish_timer_callback(self, timer):
- self.count += 1
- print("Test:", self.count)
-
- t = Test()
- c= Client()
|