[英]nanoFramework ESP32 Not waking up after sleep with Keypad
I am doing a project with a numeric keypad, an ESP32 programmed in nanoFramework (CoreLibrary 1.9.0 p5, Esp32 1.3.2 p9).我正在做一个带有数字键盘的项目,一个在 nanoFramework 中编程的 ESP32(CoreLibrary 1.9.0 p5,Esp32 1.3.2 p9)。 Now I want to wake up the controller with a keypress on one of the buttons.
现在我想通过按下其中一个按钮来唤醒控制器。 The code for handling the matrix works fine, buttons are responsive and working:
处理矩阵的代码工作正常,按钮响应灵敏且工作正常:
var row4 = controller.OpenPin(32);
row4.SetDriveMode(GpioPinDriveMode.Output);
...
var col3 = controller.OpenPin(12);
col3.SetDriveMode(GpioPinDriveMode.InputPullDown);
Before going to sleep i redefine the drive modes to have one pin at 3.3V:在睡觉之前,我重新定义了驱动模式,使一个引脚电压为 3.3V:
Sleep.EnableWakeupByPin(Sleep.WakeupGpioPin.Pin32, 1);
col3.SetDriveMode(GpioPinDriveMode.OutputOpenDrainPullUp);
Sleep.StartLightSleep();
So the ESP32 goes into sleep as expected, but I cannot wake it up with pin 32.所以ESP32按预期进入睡眠状态,但我无法用引脚32唤醒它。
What I've tried:我试过的:
WakeupGpioPin
-enum only contains normal GPIO numbers.WakeupGpioPin
-enum 只包含普通的 GPIO 编号。EnableWakeupByPin
seems to be the voltage level and 1 beeing HIGH, according to the espressif Docs .EnableWakeupByPin
的“level”参数似乎是电压电平和 1 beeing HIGH。 However, I also tried 0.The pin numbering is per the Espressif documentation.引脚编号根据 Espressif 文档。 You don't need to configure the GPIO pins before the call to EnableWakeupByPin unless used by application.
除非应用程序使用,否则您不需要在调用 EnableWakeupByPin 之前配置 GPIO 引脚。
I have tested this and It looks like the Sleep.EnableWakeupByPin() is not working.我已经对此进行了测试,看起来 Sleep.EnableWakeupByPin() 不起作用。 We will look into the cause and get it fixed.
我们将调查原因并修复它。
Try using the Sleep.EnableWakeupByMultiPins().尝试使用 Sleep.EnableWakeupByMultiPins()。 I have tested and that is working.
我已经测试过,这是有效的。
Sleep.EnableWakeupByMultiPins(Sleep.WakeupGpioPin.Pin32, Sleep.WakeupMode.AnyHigh);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.