Hi, I'm brand new to using an Arduino and do not know anything about using it. I have been trying to use a micro switch to when pressed type the letter L. I have just been using codes from other projects and splicing them together. This is what I have now, it is not working and any help would be greatly appreciated.
#include <ezButton.h>
#include <Keyboard.h>
ezButton limitSwitch(7); // create ezButton object that attach to pin 7;
int pinL = 7;
void setup() {
Serial.begin(9600);
limitSwitch.setDebounceTime(50); // set debounce time to 50 milliseconds
{
pinMode(pinL, INPUT_PULLUP);
}
void loop(); {
limitSwitch.loop(); // MUST call the loop() function first
if(limitSwitch.isPressed())
Serial.println("The limit switch: UNTOUCHED -> TOUCHED");
if(limitSwitch.isReleased())
Serial.println("The limit switch: TOUCHED -> UNTOUCHED");
int state = limitSwitch.getState();
if(state == HIGH)
Serial.println("The limit switch: UNTOUCHED");
else
Serial.println("The limit switch: TOUCHED");
if (digitalRead(pinL) == LOW)
{
Keyboard.write('L');
delay(500);
}
}
It tells me "Keyboard not found", if anyone could help it would be great. I know it sounds like a simple project but I just started today.
I just realized that my board is not capatable, I'm using a Nano. Is there any way I could still do what I'm trying to do, or will I have to upgrade my board?