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.
Dependencies: USBDevice mbed tsi_sensor
Fork of USBKeyboard_HelloWorld by
Revision 7:25929b61cf0a, committed 2017-07-07
- Comitter:
- naray23
- Date:
- Fri Jul 07 01:07:06 2017 +0000
- Parent:
- 6:17871da2a7e4
- Commit message:
- NONE
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| tsi_sensor.lib | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Mar 01 13:23:58 2013 +0000
+++ b/main.cpp Fri Jul 07 01:07:06 2017 +0000
@@ -1,5 +1,6 @@
#include "mbed.h"
#include "USBKeyboard.h"
+#include "tsi_sensor.h"
//LED1: NUM_LOCK
//LED2: CAPS_LOCK
@@ -8,14 +9,29 @@
//USBKeyboard
USBKeyboard keyboard;
+
+#if defined (TARGET_KL25Z) || defined (TARGET_KL46Z)
+ #define ELEC0 9
+ #define ELEC1 10
+#elif defined (TARGET_KL05Z)
+ #define ELEC0 9
+ #define ELEC1 8
+#else
+ #error TARGET NOT DEFINED
+#endif
-int main(void) {
- while (1) {
- keyboard.mediaControl(KEY_VOLUME_DOWN);
- keyboard.printf("Hello World from Mbed\r\n");
- keyboard.keyCode('s', KEY_CTRL);
- keyboard.keyCode(KEY_CAPS_LOCK);
- wait(1);
- leds = keyboard.lockStatus();
+int main(void)
+{
+ TSIAnalogSlider tsi(ELEC0, ELEC1, 40);
+ while (1)
+ {
+ if(tsi.readPercentage() > 0.5)
+ {
+ keyboard.printf("Gopalakrishnan.N\r\n");
+ keyboard.printf("n.gopalkrishnan@ves.ac.in\r\n");
+ keyboard.keyCode('s', KEY_CTRL);
+ wait(1);
+ leds = keyboard.lockStatus();
+ }
}
}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsi_sensor.lib Fri Jul 07 01:07:06 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Kojto/code/tsi_sensor/#395a4619c41f
