I have a small project that I have in mind and I'm pretty new with Arduino.
I want to make a small device that if a key was pressed it would do something.
Now I know I could use a button with the device but I want to specifically use a Cherry MX Blue Switch.
So I wanted to know if the test code I wrote up would get me in the right stating place and I want to know where I would wire the key switch onto the board.
From how I have the code written I'm guessing I connect the positive pin from the switch to P0 on the board and the other pin to ground on the board, is this correct?
#include "DigiKeyboard.h"
void setup() {
pinMode(0, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(0)==HIGH){
DigiKeyboard.sendKeyStroke(MOD_GUI_LEFT,KEY_R);
DigiKeyboard.print("test");
}
}