[USB]
説明
Sends a keystroke to a connected computer.
Keyboard.print() must be called after initiating Keyboard.begin().
WARNING: When you use the Keyboard.print() command, the 86Duino takes over your keyboard! Make sure you have control before you use the command. A push-button to toggle the keyboard control state is effective.
構文
Keyboard.print(character)
Keyboard.print(characters)
媒介変数
文字: a char or int to be sent to the computer as a keystrokecharacters: a string to be sent to the computer as a keystroke
戻り値
int: number of bytes sent
例
void setup() {
// make pin 2 an input and turn on the
// pullup resistor so it goes high unless
// connected to ground:
pinMode(2, INPUT_PULLUP);
Keyboard.begin();
}
void loop() {
//if the button is pressed
if(digitalRead(2)==LOW){
//Send the message
Keyboard.print("Hello!");
delay(100);
}
}参照
- Keyboard.begin()
- Keyboard.end()
- Keyboard.press()
- Keyboard.println()
- Keyboard.release()
- Keyboard.releaseAll()
- Keyboard.write()
Language Reference Home
86Duinoリファレンスのテキストは、Arduinoリファレンスを改変したもので、Creative Commons Attribution-ShareAlike 3.0ライセンスに基づいてライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。