2016-10-18 80 views
0

doc不工作时,对于gpio.trig语法是在NodeMCU,gpio.trig()如预期

 
gpio.trig(pin, [type [, callback_function]]) 

但是,以下三种情况之一产生一个错误:

 
gpio.mode(8, gpio.INT) 
gpio.trig(8)   -- this works 
gpio.trig(8, 'both') -- this bombs 
-- ERROR: stdin:1: bad argument #3 to 'trig' (invalid callback type)s 

我在这里错过了一些细微差别,还是在文档中有错误?

回答

2

随时验证,并可能在我们的GitHub问题列表中报告。我不能确定,但​​是如果您已经清除了针脚上的回调,这可能(但不应该)发生。该文件说

Establish or clear a callback function to run on interrupt for a pin.

所以,如果你拨打gpio.trig相同的引脚上多次W/O回调函数可能窒息。

+0

好的。在那里提出问题 –