Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Keyboard.h"
- const int Button_3 = 2;
- const int Button_4 = 9;
- int buttonState_3 = 0;
- int lastbuttonState_3 = 0;
- int buttonState_4 = 0;
- int lastbuttonState_4 = 0;
- void setup(){
- pinMode(Button_3, INPUT_PULLUP);
- pinMode(Button_4, INPUT_PULLUP);
- }
- void loop(){
- buttonState_3 = digitalRead(Button_3);
- if(buttonState_3 == HIGH){
- Serial.print("3");
- //Keyboard.print("W");
- lastbuttonState_3 = buttonState_3;
- }
- buttonState_4 = digitalRead(Button_4);
- if(buttonState_4 == HIGH){
- Serial.print("4");
- //Keyboard.print("A");
- lastbuttonState_4 = buttonState_4;
- }
- }
Add Comment
Please, Sign In to add comment