mirror of
https://github.com/KevinMidboe/Arduino.git
synced 2025-10-29 09:30:12 +00:00
25 lines
440 B
C++
Executable File
25 lines
440 B
C++
Executable File
const int buttonPin = 4;
|
|
int buttonState = LOW;
|
|
|
|
void setup()
|
|
{
|
|
pinMode(buttonPin, LOW);
|
|
Keyboard.begin();
|
|
}
|
|
|
|
void loop()
|
|
{
|
|
int buttonState = digitalRead(buttonPin);
|
|
if (buttonState == HIGH)
|
|
{
|
|
Keyboard.press((char) 0x80);
|
|
Keyboard.press((char) 0x20);
|
|
Keyboard.releaseAll();
|
|
Keyboard.print("Photoshop");
|
|
Keyboard.write((char) 0xB0);
|
|
Keyboard.releaseAll();
|
|
delay(500);
|
|
}
|
|
}
|
|
|