Pular para o conteúdo principal

Primeiros passos com botões configuráveis

Este repositório demonstra como usar os botões configuráveis no Wio Terminal. Há três botões que podem ser usados para o Wio Terminal.

Código de exemplo

Nota: WIO_KEY_A, WIO_KEY_B e WIO_KEY_C são definidos para os botões configuráveis do Wio Terminal.

nota

Você também pode usar BUTTON_1, BUTTON_2 e BUTTON_3 para usar os botões configuráveis.

void setup() {
Serial.begin(115200);
pinMode(WIO_KEY_A, INPUT_PULLUP);
pinMode(WIO_KEY_B, INPUT_PULLUP);
pinMode(WIO_KEY_C, INPUT_PULLUP);
}

void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(WIO_KEY_A) == LOW) {
Serial.println("A Key pressed");
}
else if (digitalRead(WIO_KEY_B) == LOW) {
Serial.println("B Key pressed");
}
else if (digitalRead(WIO_KEY_C) == LOW) {
Serial.println("C Key pressed");
}
delay(200);
}
Loading Comments...