Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Keyboard.h>
- boolean butt_flag = 0;
- unsigned long last_press;
- boolean butt;
- void setup() {
- Serial.begin(9600);
- pinMode(8, INPUT_PULLUP);
- pinMode(10, OUTPUT);
- }
- /*void btn1() { //Эмуляция 0 кнопка
- Keyboard.write('N');
- delay(200);
- digitalWrite(10, true);
- } */
- void loop() {
- Keyboard.begin();
- if ( digitalRead(8) == 0 && butt_flag == 0) {
- digitalWrite(10, true);
- butt_flag = 1;
- }
- if ( digitalRead(8) == 1 && butt_flag == 1) {
- digitalWrite(10, false);
- butt_flag = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement