当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Arduino Arduino_EMBRYO_2 - readBtnEmergencyStop()用法及代码示例


返回连接到紧急停止按钮的引脚中的布尔值。此按钮调用紧急停止 ISR 和 end() 方法。

用法

axis.readBtnEmergencyStop()

返回

急停按钮信号:LOW 或 HIGH。

示例

#include <Arduino_EMBRYO_2.h>

StepMotor axis(1, A5, 5, 6, 3, 4, A2, A1, 2, 12);

void setup() {
  Serial.begin(9600);
  while (!Serial) {};
  axis.begin();
  Serial.println("Emergency Stop button logic");
  Serial.println("Not pressed: " + String(axis.readBtnEmergencyStop()));
  Serial.println("Pressed: " + String(!axis.readBtnEmergencyStop()));
}
void loop() {}

相关用法


注:本文由纯净天空筛选整理自arduino.cc大神的英文原创作品 Arduino_EMBRYO_2 - readBtnEmergencyStop()。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。