2 buttons and 2 switches, compiles, not tested
Dependencies: mbed C12832 MMA7660 USBDevice
Diff: main.cpp
- Revision:
- 22:f7e4b453f684
- Parent:
- 21:53426ae5b7b1
--- a/main.cpp Sun Oct 27 12:19:15 2019 +0000 +++ b/main.cpp Sun Oct 27 17:13:56 2019 +0000 @@ -3,31 +3,10 @@ #include "MMA7660.h" #include "C12832.h" -#include "stdint.h" -#define REPORT_ID_KEYBOARD 1 -#define REPORT_ID_VOLUME 3 - - -typedef struct { - unsigned char usage; - unsigned char modifier; -} KEYMAP; - -#ifdef US_KEYBOARD -/* US keyboard (as HID standard) */ -#define KEYMAP_SIZE (152) -const KEYMAP keymap[KEYMAP_SIZE] = { - - {0x28, 0}, /* LF */ /* Keyboard Return (Enter) */ - -}; -#endif - MMA7660 Accelerometer (p28,p27); //define accelerometer USBKeyboard Usbkeyboard; //define keyboard C12832 LCD (p5,p7,p6,p8,p11); //define LCD - DigitalOut led1(p12); //leds DigitalOut led2(p13); DigitalOut led3(p14); @@ -35,8 +14,8 @@ DigitalIn Switch1 (p8); //switch mode 1 (arrows) and 2 (letters) DigitalIn Switch2 (p16); //switch to numbers -DigitalIn Switch3 (p15); //enter -DigitalIn Switch4 (p14); //spacebar +DigitalIn Switch3 (p17); //enter +DigitalIn Switch4 (p18); //spacebar int main (void) //main program { @@ -57,7 +36,7 @@ if (Switch3){ - Usbkeyboard.keyCode(0x28, 0); //enter will be HERE + Usbkeyboard.keyCode (RIGHT_ARROW); //enter will be HERE } @@ -159,6 +138,5 @@ } -return false; + return false; } -