From b0ebd814f01e05ce39d4d53f2ad145412f8c3a92 Mon Sep 17 00:00:00 2001 From: arpruss Date: Wed, 12 Sep 2018 08:20:55 -0500 Subject: [PATCH] work with latest USBComposite library --- examples/CapacitiveController/CapacitiveController.ino | 8 ++++++-- library.properties | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/CapacitiveController/CapacitiveController.ino b/examples/CapacitiveController/CapacitiveController.ino index 280e277..6b855fc 100755 --- a/examples/CapacitiveController/CapacitiveController.ino +++ b/examples/CapacitiveController/CapacitiveController.ino @@ -1,5 +1,5 @@ #include -#include // https://github.com/arpruss/USBHID_stm32f1 +#include // https://github.com/arpruss/USBHID_stm32f1 // // This requires an stm32f1 board compatible with the no-grounding-pin feature of ADCTouchSensor. @@ -8,6 +8,10 @@ #define LED_BUILTIN PB12 // change to match your board #define JOYSTICK_MODE PA10 // ground to set joystick mode +USBHID HID; +HIDJoystick Joystick(HID); +HIDKeyboard Keyboard(HID); + #define NUM_PINS 10 unsigned pins[NUM_PINS] = {PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PA8,PA9}; unsigned keys[NUM_PINS] = {' ',KEY_UP_ARROW,KEY_LEFT_ARROW,KEY_DOWN_ARROW,KEY_RIGHT_ARROW,'w','a','s','d','f'}; // Makey-Makey also has 'g' and CLICK, but we don't have enough ADC channels @@ -43,7 +47,7 @@ uint8_t joystickMode = 0; void setup() { - USBHID.begin(HID_KEYBOARD_JOYSTICK); + HID.begin(HID_KEYBOARD_JOYSTICK); pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, 0); diff --git a/library.properties b/library.properties index e87dd2c..c7efe8f 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ADCTouchSensor -version=0.0.8 +version=0.0.9 author=Alexander Pruss maintainer=arpruss sentence=Create Touch Sensors with a single analog pin without external hardware