From 96c75e7601286341d2dc99b55497848b5bf1775b Mon Sep 17 00:00:00 2001 From: AsherThomasBabu <44612160+AsherThomasBabu@users.noreply.github.com> Date: Fri, 13 Mar 2020 09:41:24 +0530 Subject: [PATCH 1/4] Create write.ino An example that is already present in the Arduino.cc website, but missing in the official libraries. --- examples/Serial/write.ino | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/Serial/write.ino diff --git a/examples/Serial/write.ino b/examples/Serial/write.ino new file mode 100644 index 0000000..dc8894b --- /dev/null +++ b/examples/Serial/write.ino @@ -0,0 +1,19 @@ +//Example to understand the basic working of the Keyboard.write() function + +#include + +void setup() { + // make pin 2 an input and turn on the + // pullup resistor so it goes high unless + // connected to ground: + pinMode(2, INPUT_PULLUP); + Keyboard.begin(); +} + +void loop() { + //if the button is pressed + if (digitalRead(2) == LOW) { + //Send an ASCII 'A', + Keyboard.write(65); + } +} From 64dfb303de67a38c59fa2b2923c8b738988ecfc2 Mon Sep 17 00:00:00 2001 From: AsherThomasBabu <44612160+AsherThomasBabu@users.noreply.github.com> Date: Sat, 14 Mar 2020 14:44:59 +0530 Subject: [PATCH 2/4] Rename write.ino to Keyboard_Print.ino --- examples/Serial/{write.ino => Keyboard_Print.ino} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/Serial/{write.ino => Keyboard_Print.ino} (100%) diff --git a/examples/Serial/write.ino b/examples/Serial/Keyboard_Print.ino similarity index 100% rename from examples/Serial/write.ino rename to examples/Serial/Keyboard_Print.ino From 485170a736a3456913d076e44c6ec8b9318de494 Mon Sep 17 00:00:00 2001 From: AsherThomasBabu <44612160+AsherThomasBabu@users.noreply.github.com> Date: Sat, 14 Mar 2020 14:46:03 +0530 Subject: [PATCH 3/4] Update Keyboard_Print.ino --- examples/Serial/Keyboard_Print.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/Serial/Keyboard_Print.ino b/examples/Serial/Keyboard_Print.ino index dc8894b..bdaaf69 100644 --- a/examples/Serial/Keyboard_Print.ino +++ b/examples/Serial/Keyboard_Print.ino @@ -13,7 +13,7 @@ void setup() { void loop() { //if the button is pressed if (digitalRead(2) == LOW) { - //Send an ASCII 'A', - Keyboard.write(65); + //Send the message + Keyboard.print("Hello!"); } } From 320e50c8a03e2e025852a7e9e1a3a71ea8092994 Mon Sep 17 00:00:00 2001 From: AsherThomasBabu <44612160+AsherThomasBabu@users.noreply.github.com> Date: Sat, 14 Mar 2020 14:47:33 +0530 Subject: [PATCH 4/4] Rename examples/Serial/Keyboard_Print.ino to examples/Print_Hello/Print_Hello.ino --- .../{Serial/Keyboard_Print.ino => Print_Hello/Print_Hello.ino} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/{Serial/Keyboard_Print.ino => Print_Hello/Print_Hello.ino} (100%) diff --git a/examples/Serial/Keyboard_Print.ino b/examples/Print_Hello/Print_Hello.ino similarity index 100% rename from examples/Serial/Keyboard_Print.ino rename to examples/Print_Hello/Print_Hello.ino