1821 views|2 replies

33

Posts

0

Resources
The OP
 

Pyboard timer terminal callback function problem [Copy link]

 

The timer executes the callback function once every 2ms. Print the timer value,

When using lambda function, it can be printed many times (25 lines)

When a function is defined with 20 lines and then called in a callback function, it can only be printed once. Why is this?

image.png (18.32 KB, downloads: 0)

image.png

Latest reply

The second floor is an expert in pyboard   Details Published on 2021-5-27 22:35
 
 

1w

Posts

25

Resources
2
 

The calling method is wrong. Only the function name is required, without brackets and parameters. This is equivalent to using the function running result as the callback function parameter.

In addition, the print function is very slow. If you have high performance requirements, try not to use print in interrupts.

 
 
 

6555

Posts

0

Resources
3
 

The second floor is an expert in pyboard

 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list