Created
May 18, 2019 06:43
-
-
Save takesako/6c85871b258b9974402195d64d99dca7 to your computer and use it in GitHub Desktop.
sample program
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "DigiKeyboard.h" | |
#include <avr/pgmspace.h> | |
const uint8_t RTC[] PROGMEM = "Recruit Technologies Co., Ltd. "; | |
const uint8_t ATL[] PROGMEM = "Advanced Technology Lab. "; | |
#define KEY_ENTER 0x28 | |
#define KEY_CAPSLOCK 0x39 | |
// https://gist.github.com/MightyPork/6da26e382a7ad91b5496ee55fdc73db2 | |
void println(const uint8_t *s) { | |
uint8_t a, i; | |
i = 0; | |
do { | |
a = pgm_read_byte(s + i++); | |
DigiKeyboard.write(a); | |
} while (a); | |
DigiKeyboard.sendKeyStroke(KEY_ENTER); | |
} | |
void setup() { | |
DigiKeyboard.sendKeyStroke(0); | |
pinMode(1, OUTPUT); | |
} | |
void loop() { | |
println(RTC); | |
println(ATL); | |
delay(500); | |
DigiKeyboard.sendKeyStroke(KEY_CAPSLOCK, MOD_SHIFT_LEFT); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment