Skip to content

Instantly share code, notes, and snippets.

@shohei
Created April 27, 2018 08:43
Show Gist options
  • Save shohei/00154bdfd3c60ca31b668e12d47aa9a1 to your computer and use it in GitHub Desktop.
Save shohei/00154bdfd3c60ca31b668e12d47aa9a1 to your computer and use it in GitHub Desktop.
Video record server using Intel NUC kit
#include "Keyboard.h"
#define Button1 9
#define LEDpin 2
int state = HIGH;
void setup() {
Keyboard.begin();
pinMode(Button1, INPUT_PULLUP);
pinMode(LEDpin,OUTPUT);
digitalWrite(LEDpin,state);
}
void loop() {
if(digitalRead(Button1) == LOW){
Keyboard.press('a');
state = !state;
digitalWrite(LEDpin,state);
delay(100);
Keyboard.releaseAll();
while(digitalRead(Button1) == LOW);
}
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment