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


Arduino Mouse - Mouse.end()用法及代码示例


停止模拟连接到计算机的鼠标。要开始控制,请使用 Mouse.begin()

用法

Mouse.end()

参数

None。

返回

None。

示例

#include <Mouse.h>

void setup() {
  pinMode(2, INPUT);
  // Initiate the Mouse library
  Mouse.begin();
}

void loop() {
  // If the button is pressed, send a left mouse click
  if (digitalRead(2) == HIGH) {
    Mouse.click();
    // Then end the Mouse emulation
    Mouse.end();
  }
}

相关用法


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