You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Kaleidoscope/examples/Devices/Keyboardio/m100test-serial/m100test-serial.ino

28 lines
595 B

// -*- mode: c++ -*-
#include <Arduino.h>
#include <Kaleidoscope.h>
#include <Kaleidoscope-Macros.h>
KALEIDOSCOPE_INIT_PLUGINS(Macros);
void setup() {
Kaleidoscope.setup();
}
void loop() {
auto s = Kaleidoscope.device().serialPort();
if (s.available()) {
uint8_t r = s.read();
if (r == '1') {
s.println("Hello");
Kaleidoscope.device().hid().keyboard().pressKey(Key_H);
Kaleidoscope.device().hid().keyboard().sendReport();
Kaleidoscope.device().hid().keyboard().releaseKey(Key_H);
Kaleidoscope.device().hid().keyboard().sendReport();
}
}
}