void setup() {
// You don't need to initialize anything for
// this simple code.
}
// loop() function will loop all
// the time doing the same thing over, and over again!
void loop()
{
// delaying at the beginning is good till the OS
// detects the hardware.
delay(5500);
/* open run command in windows */
Keyboard.set_modifier(MODIFIERKEY_RIGHT_GUI); // WIN key
Keyboard.set_key1(KEY_R); // "R" key
Keyboard.send_now(); // send everything
delay(3500); // delay till the "run command" opens
// sometimes it takes time!
/* clear the modifier and key1 */
Keyboard.set_modifier(0);
Keyboard.set_key1(0);
Keyboard.send_now(); // send everything
delay(2500); // I love delays =p
/* write notepad.exe and press enter
to open notepad */
Keyboard.print("notepad.exe");
Keyboard.set_key1(KEY_ENTER); // Enter key
Keyboard.send_now(); // send everything
/* clear key1 */
Keyboard.set_key1(0);
Keyboard.send_now(); // send everything
delay(2500); // I told you i love delays
/* Write something and press enter */
Keyboard.print("Hello there....?");
Keyboard.set_key1(KEY_ENTER);
Keyboard.send_now();
Keyboard.set_key1(0);
Keyboard.send_now();
delay(2500);
Keyboard.print("Well, I'm a small device that programmed by Qnix");
Keyboard.set_key1(KEY_ENTER);
Keyboard.send_now();
Keyboard.set_key1(0);
Keyboard.send_now();
delay(2500);
Keyboard.print("I do nothing in the mean time, but he will make me do things...");
Keyboard.set_key1(KEY_ENTER);
Keyboard.send_now();
Keyboard.set_key1(0);
Keyboard.send_now();
delay(2500);
// delay( FOR EVER );
// at the end you can delay for ever or find a way to stop it! =)
}
this code in arduino IDE and select teensy 2.0 Can compile.
but i select arduino leonardo cann't compile.
i need this code to arduino leonardo how to do?
I tried to add #include, but appeared a lot of error.
Chinese English, hope everybody can help me.