Key.begin()
From Microduino Wiki
Key.begin(mode)
Description Initial a switch, set the input mode which is INPUT by default, and INPUT_PULLUP is optional. Parameter Mode: INPUT or INPUT_PULLUP, the default is INPUT. Return value None Sample
#include <Microduino_Key.h>
AnalogKey keyAnalog(A0);
void setup() {
Serial.begin(9600);
keyAnalog.begin(INPUT);
}
void loop() {
}
#include <Microduino_Key.h>
DigitalKey keyDigital(A0);
void setup() {
Serial.begin(9600);
keyDigital.begin(INPUT_PULLUP);
}
void loop() {
}
#include <Microduino_Key.h>
VirtualKey keyVirtual;
void setup() {
Serial.begin(9600);
keyVirtual.begin();
}
void loop() {
} Others |