Skip to content

Commit

Permalink
work with latest USBComposite library
Browse files Browse the repository at this point in the history
  • Loading branch information
arpruss committed Sep 12, 2018
1 parent 3867692 commit b0ebd81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions examples/CapacitiveController/CapacitiveController.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <ADCTouchSensor.h>
#include <USBHID.h> // https://github.com/arpruss/USBHID_stm32f1
#include <USBComposite.h> // https://github.com/arpruss/USBHID_stm32f1

//
// This requires an stm32f1 board compatible with the no-grounding-pin feature of ADCTouchSensor.
Expand All @@ -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
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ADCTouchSensor
version=0.0.8
version=0.0.9
author=Alexander Pruss
maintainer=arpruss <[email protected]>
sentence=Create Touch Sensors with a single analog pin without external hardware
Expand Down

0 comments on commit b0ebd81

Please sign in to comment.