在使用micropython的Timer时,发现在回调函数中调用上面写好的函数,会报错:比如如下代码:
- def DZ_RowScanCalBack(t):
- if(nowScanColumn == 8):
- nowScanColumn = 0
- DZ_WriteData(0x01 << nowScanColumn,scanData[index][nowScanColumn])
- nowScanColumn = nowScanColumn + 1
- def DZ_StartRowScan():
- tm=Timer(1, freq=20, callback = DZ_RowScanCalBack)
会报:
- >>> uncaught exception in Timer(1) interrupt handler
- NameError:
这样的错误,求解决办法~~