Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:a3bde7e2c11e, committed 2022-06-16
- Comitter:
- cspista
- Date:
- Thu Jun 16 12:59:30 2022 +0000
- Child:
- 1:b1c07ebce303
- Commit message:
- Final version
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBDevice.lib Thu Jun 16 12:59:30 2022 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/USBDevice/#53949e6131f6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Jun 16 12:59:30 2022 +0000
@@ -0,0 +1,60 @@
+
+/* USB Keyboard extended example
+ * This program will emulate an USB keyboard and
+ * emits predefined key sequences when teh corresponding
+ * button was pressed
+ *
+ * Tested on NUCLEO-F446RE board with Arduino Multifunction Board using Mbed 2
+ */
+#include "mbed.h"
+#include "USBKeyboard.h"
+
+DigitalIn B1(BUTTON1,PullUp);
+DigitalIn S1(A1,PullUp);
+DigitalIn S2(A2,PullUp);
+DigitalIn S3(A3,PullUp);
+USBKeyboard keyboard;
+
+int B1state = 1;
+int S1state = 1;
+int S2state = 1;
+int S3state = 1;
+
+int main(void)
+{
+ while (1) {
+ if (B1state && !B1) {
+ keyboard.mediaControl(KEY_VOLUME_DOWN);
+ keyboard.printf("Hello World from Mbed USBKeyboard demo\r\n");
+ keyboard.keyCode('s', KEY_CTRL);
+ keyboard.keyCode(KEY_CAPS_LOCK);
+ B1state = 0;
+ wait(1);
+ } else if(!B1state && B1) B1state = 1;
+
+ if (S1state && !S1) {
+ keyboard.keyCode('r', KEY_LOGO); // Windows kay + R key command
+ keyboard.printf("https://megtestesules.info\r\n ");
+ S1state = 0;
+ wait(1);
+ }
+ else if(!S1state && S1) S1state = 1;
+
+ if (S2state && !S2) {
+ keyboard.keyCode('r', KEY_LOGO); // Windows key + R key command
+ keyboard.printf("https://megtestesules.info/hobbielektronika/\r\n ");
+ S2state = 0;
+ wait(1);
+ }
+ else if(!S2state && S2) S2state = 1;
+
+ if (S3state && !S3) {
+ keyboard.keyCode('r', KEY_LOGO); // Windows key + R key command
+ keyboard.printf("https://cspista.hu/\r\n ");
+ S3state = 0;
+ wait(1);
+ }
+ else if(!S3state && S3) S3state = 1;
+ wait(0.02);
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Jun 16 12:59:30 2022 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file