0

Neokey Trinkey + Arduino keyboard
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Neokey Trinkey + Arduino keyboard

by hberg32 on Sat Feb 12, 2022 4:57 pm

Has anyone tried to use the Neokey TrinKey for keyboard presses (such as a password enterer) with Arduino and had any luck? The Adafruit example Arduino_HID_Cap_touch_Example program works fine for me to send the MEDIA_PLAY_PAUSE key so I tried making the following changes to make it send "hello world" but nothing is sent.

My changes to the example program are to change line 28 to "Keyboard.begin()" and line 53 to "Keyboard.println("Hello World!");" Seems like it should work but no go. One thing I notice is that the Windows Device Manager doesn't show the Trinkey in the "Keyboards" group (but does list it in the "Human Interface Devices" group). Could it be that the device is not properly reporting itself as a keyboard?

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_NeoPixel.h>
#include "Adafruit_FreeTouch.h"
#include "HID-Project.h"  // https://github.com/NicoHood/HID

// Create the neopixel strip with the built in definitions NUM_NEOPIXEL and PIN_NEOPIXEL
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_NEOPIXEL, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800);

// Create the touch pad
Adafruit_FreeTouch qt = Adafruit_FreeTouch(PIN_TOUCH, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE);

int16_t neo_brightness = 20; // initialize with 20 brightness (out of 255)

bool last_switch = true;

void setup() {
  Serial.begin(9600);
  //while (!Serial);
  strip.begin();
  strip.setBrightness(neo_brightness);
  strip.show(); // Initialize all pixels to 'off'

  if (! qt.begin())
    Serial.println("Failed to begin qt");

  pinMode(PIN_SWITCH, INPUT_PULLDOWN);

  // Sends a clean report to the host. This is important on any Arduino type.
  Keyboard.begin();
}

uint8_t j=0;
void loop() {
  // measure the captouches
  uint16_t touch = qt.measure();
  // don't print touch data constantly, only every 10 runs
  if (j % 10 == 0) {
    Serial.print("Touch: "); Serial.println(touch);
  }

  // If the pad is touched, turn on neopix!
  if (touch > 500) {
    Serial.println("Touched!");
    strip.setBrightness(neo_brightness);
  } else {
    strip.setBrightness(0);
  }

  // check mechswitch
  bool curr_switch = digitalRead(PIN_SWITCH);
  if (curr_switch != last_switch) {
    if (curr_switch) {
      Serial.println("Pressed");
//      Consumer.write(MEDIA_PLAY_PAUSE);
       Keyboard.println("Hello World!");
    } else {
      Serial.println("Released");
    }
    last_switch = curr_switch;
  }


  // cycles of all colors on wheel, only visible if cap it touched
  strip.setPixelColor(0, Wheel(j++));
  strip.show();

  delay(10);
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
  if(WheelPos < 85) {
   return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
  } else if(WheelPos < 170) {
   WheelPos -= 85;
   return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  } else {
   WheelPos -= 170;
   return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
}

hberg32
 
Posts: 41
Joined: Mon Apr 07, 2014 2:38 pm

Re: Neokey Trinkey + Arduino keyboard

by hberg32 on Sat Feb 12, 2022 5:04 pm

I should mention that I'm using Arduino IDE 1.8.19 and that I manually applied the same changes LadyAda made to samd.cpp in the HID-Project library to clear the compile errors (I think her PR hasn't been released yet).

hberg32
 
Posts: 41
Joined: Mon Apr 07, 2014 2:38 pm

Re: Neokey Trinkey + Arduino keyboard

by hberg32 on Sat Feb 12, 2022 5:19 pm

Ah, nevermind, this can be closed. It's just a Windows 7 problem. Works fine on Windows 10.

hberg32
 
Posts: 41
Joined: Mon Apr 07, 2014 2:38 pm

Re: Neokey Trinkey + Arduino keyboard

by gadgeteer on Sat Apr 09, 2022 7:19 pm

Hi, I was trying to run the Arduino_HID_Cap_touch_Example and ran into compile errors. Using Arduino IDE 1.8.19, Arduino SAMD and Adafruit SAMD board defs all updated to latest, HID_Project library updated to latest. (See below). Here is the debug with the errors:

Code: Select all | TOGGLE FULL SIZE
In file included from C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/Arduino.h:157,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\BootMouse.h:27,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\BootMouse.cpp:24:
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\BootMouse.cpp: In member function 'virtual int BootMouse_::getInterface(uint8_t*)':
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:37:56: warning: narrowing conversion of '(int)(((unsigned char)((int)((BootMouse_*)this)->BootMouse_::<anonymous>.PluggableUSBModule::pluggedEndpoint)) | 128)' from 'int' to 'uint8_t' {aka 'unsigned char'} [-Wnarrowing]
   37 | #define USB_ENDPOINT_IN(addr)                  ((addr) | 0x80)
      |                                                ~~~~~~~~^~~~~~~
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:276:10: note: in definition of macro 'D_ENDPOINT'
  276 |  { 7, 5, _addr,_attr,_packetSize, _interval }
      |          ^~~~~
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\BootMouse.cpp:74:14: note: in expansion of macro 'USB_ENDPOINT_IN'
   74 |   D_ENDPOINT(USB_ENDPOINT_IN(pluggedEndpoint), USB_ENDPOINT_TYPE_INTERRUPT, USB_EP_SIZE, 0x01)
      |              ^~~~~~~~~~~~~~~
In file included from d:\documents\arduino\libraries\hid-project\src\hid-apis\KeyboardAPI.h:29,
                 from d:\documents\arduino\libraries\hid-project\src\hid-apis\nkrokeyboardapi.h:27,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleNKROKeyboard.h:30,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleNKROKeyboard.cpp:24:
d:\documents\arduino\libraries\hid-project\src\keyboardlayouts\improvedkeylayouts.h:54:21: note: #pragma message: Using default ASCII layout for keyboard modules
   54 |     #pragma message "Using default ASCII layout for keyboard modules"
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/Arduino.h:157,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\BootKeyboard.h:27,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\BootKeyboard.cpp:24:
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\BootKeyboard.cpp: In member function 'virtual int BootKeyboard_::getInterface(uint8_t*)':
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:37:56: warning: narrowing conversion of '(int)(((unsigned char)((int)((BootKeyboard_*)this)->BootKeyboard_::<anonymous>.PluggableUSBModule::pluggedEndpoint)) | 128)' from 'int' to 'uint8_t' {aka 'unsigned char'} [-Wnarrowing]
   37 | #define USB_ENDPOINT_IN(addr)                  ((addr) | 0x80)
      |                                                ~~~~~~~~^~~~~~~
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:276:10: note: in definition of macro 'D_ENDPOINT'
  276 |  { 7, 5, _addr,_attr,_packetSize, _interval }
      |          ^~~~~
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\BootKeyboard.cpp:86:14: note: in expansion of macro 'USB_ENDPOINT_IN'
   86 |   D_ENDPOINT(USB_ENDPOINT_IN(pluggedEndpoint), USB_ENDPOINT_TYPE_INTERRUPT, USB_EP_SIZE, 0x01)
      |              ^~~~~~~~~~~~~~~
In file included from C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/Arduino.h:157,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleConsumer.h:27,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleConsumer.cpp:24:
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleConsumer.cpp: In member function 'virtual int SingleConsumer_::getInterface(uint8_t*)':
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:37:56: warning: narrowing conversion of '(int)(((unsigned char)((int)((SingleConsumer_*)this)->SingleConsumer_::<anonymous>.PluggableUSBModule::pluggedEndpoint)) | 128)' from 'int' to 'uint8_t' {aka 'unsigned char'} [-Wnarrowing]
   37 | #define USB_ENDPOINT_IN(addr)                  ((addr) | 0x80)
      |                                                ~~~~~~~~^~~~~~~
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:276:10: note: in definition of macro 'D_ENDPOINT'
  276 |  { 7, 5, _addr,_attr,_packetSize, _interval }
      |          ^~~~~
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleConsumer.cpp:54:14: note: in expansion of macro 'USB_ENDPOINT_IN'
   54 |   D_ENDPOINT(USB_ENDPOINT_IN(pluggedEndpoint), USB_ENDPOINT_TYPE_INTERRUPT, USB_EP_SIZE, 0x01)
      |              ^~~~~~~~~~~~~~~
In file included from C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/Arduino.h:157,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleSystem.h:27,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleSystem.cpp:24:
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleSystem.cpp: In member function 'virtual int SingleSystem_::getInterface(uint8_t*)':
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:37:56: warning: narrowing conversion of '(int)(((unsigned char)((int)((SingleSystem_*)this)->SingleSystem_::<anonymous>.PluggableUSBModule::pluggedEndpoint)) | 128)' from 'int' to 'uint8_t' {aka 'unsigned char'} [-Wnarrowing]
   37 | #define USB_ENDPOINT_IN(addr)                  ((addr) | 0x80)
      |                                                ~~~~~~~~^~~~~~~
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:276:10: note: in definition of macro 'D_ENDPOINT'
  276 |  { 7, 5, _addr,_attr,_packetSize, _interval }
      |          ^~~~~
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleSystem.cpp:56:14: note: in expansion of macro 'USB_ENDPOINT_IN'
   56 |   D_ENDPOINT(USB_ENDPOINT_IN(pluggedEndpoint), USB_ENDPOINT_TYPE_INTERRUPT, USB_EP_SIZE, 0x01)
      |              ^~~~~~~~~~~~~~~
In file included from C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/Arduino.h:157,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleAbsoluteMouse.h:27,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleAbsoluteMouse.cpp:24:
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleAbsoluteMouse.cpp: In member function 'virtual int SingleAbsoluteMouse_::getInterface(uint8_t*)':
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:37:56: warning: narrowing conversion of '(int)(((unsigned char)((int)((SingleAbsoluteMouse_*)this)->SingleAbsoluteMouse_::<anonymous>.PluggableUSBModule::pluggedEndpoint)) | 128)' from 'int' to 'uint8_t' {aka 'unsigned char'} [-Wnarrowing]
   37 | #define USB_ENDPOINT_IN(addr)                  ((addr) | 0x80)
      |                                                ~~~~~~~~^~~~~~~
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:276:10: note: in definition of macro 'D_ENDPOINT'
  276 |  { 7, 5, _addr,_attr,_packetSize, _interval }
      |          ^~~~~
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleAbsoluteMouse.cpp:82:14: note: in expansion of macro 'USB_ENDPOINT_IN'
   82 |   D_ENDPOINT(USB_ENDPOINT_IN(pluggedEndpoint), USB_ENDPOINT_TYPE_INTERRUPT, USB_EP_SIZE, 0x01)
      |              ^~~~~~~~~~~~~~~
In file included from C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/Arduino.h:157,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleGamepad.h:27,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleGamepad.cpp:24:
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleGamepad.cpp: In member function 'virtual int SingleGamepad_::getInterface(uint8_t*)':
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:37:56: warning: narrowing conversion of '(int)(((unsigned char)((int)((SingleGamepad_*)this)->SingleGamepad_::<anonymous>.PluggableUSBModule::pluggedEndpoint)) | 128)' from 'int' to 'uint8_t' {aka 'unsigned char'} [-Wnarrowing]
   37 | #define USB_ENDPOINT_IN(addr)                  ((addr) | 0x80)
      |                                                ~~~~~~~~^~~~~~~
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:276:10: note: in definition of macro 'D_ENDPOINT'
  276 |  { 7, 5, _addr,_attr,_packetSize, _interval }
      |          ^~~~~
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleGamepad.cpp:85:14: note: in expansion of macro 'USB_ENDPOINT_IN'
   85 |   D_ENDPOINT(USB_ENDPOINT_IN(pluggedEndpoint), USB_ENDPOINT_TYPE_INTERRUPT, USB_EP_SIZE, 0x01)
      |              ^~~~~~~~~~~~~~~
In file included from C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/Arduino.h:157,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleNKROKeyboard.h:27,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleNKROKeyboard.cpp:24:
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleNKROKeyboard.cpp: In member function 'virtual int SingleNKROKeyboard_::getInterface(uint8_t*)':
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:37:56: warning: narrowing conversion of '(int)(((unsigned char)((int)((SingleNKROKeyboard_*)this)->SingleNKROKeyboard_::<anonymous>.PluggableUSBModule::pluggedEndpoint)) | 128)' from 'int' to 'uint8_t' {aka 'unsigned char'} [-Wnarrowing]
   37 | #define USB_ENDPOINT_IN(addr)                  ((addr) | 0x80)
      |                                                ~~~~~~~~^~~~~~~
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:276:10: note: in definition of macro 'D_ENDPOINT'
  276 |  { 7, 5, _addr,_attr,_packetSize, _interval }
      |          ^~~~~
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\SingleNKROKeyboard.cpp:85:14: note: in expansion of macro 'USB_ENDPOINT_IN'
   85 |   D_ENDPOINT(USB_ENDPOINT_IN(pluggedEndpoint), USB_ENDPOINT_TYPE_INTERRUPT, USB_EP_SIZE, 0x01)
      |              ^~~~~~~~~~~~~~~
In file included from C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/Arduino.h:157,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\RawHID.h:27,
                 from D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\RawHID.cpp:24:
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\RawHID.cpp: In member function 'virtual int RawHID_::getInterface(uint8_t*)':
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:37:56: warning: narrowing conversion of '(int)(((unsigned char)((int)((RawHID_*)this)->RawHID_::<anonymous>.PluggableUSBModule::pluggedEndpoint)) | 128)' from 'int' to 'uint8_t' {aka 'unsigned char'} [-Wnarrowing]
   37 | #define USB_ENDPOINT_IN(addr)                  ((addr) | 0x80)
      |                                                ~~~~~~~~^~~~~~~
C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino/USB/USBCore.h:276:10: note: in definition of macro 'D_ENDPOINT'
  276 |  { 7, 5, _addr,_attr,_packetSize, _interval }
      |          ^~~~~
D:\Documents\Arduino\libraries\HID-Project\src\SingleReport\RawHID.cpp:63:14: note: in expansion of macro 'USB_ENDPOINT_IN'
   63 |   D_ENDPOINT(USB_ENDPOINT_IN(pluggedEndpoint), USB_ENDPOINT_TYPE_INTERRUPT, USB_EP_SIZE, 0x01)
      |              ^~~~~~~~~~~~~~~
"C:\\Users\\ruber\\AppData\\Local\\Arduino15\\packages\\adafruit\\tools\\arm-none-eabi-gcc\\9-2019q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -Werror=return-type -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD "-D__SKETCH_NAME__=\"\"\"neokey_trinkey_HID_cap.ino\"\"\"" -DF_CPU=48000000L -DARDUINO=10819 -DARDUINO_NEOKEYTRINKEY_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ADAFRUIT -D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_NEOKEYTRINKEY_M0 -DARDUINO_SAMD_ZERO -DARM_MATH_CM0PLUS -DUSB_VID=0x239A -DUSB_PID=0x80FF -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit\"" "-DUSB_PRODUCT=\"NeoKey Trinkey M0\"" "-IC:\\Users\\ruber\\AppData\\Local\\Arduino15\\packages\\adafruit\\hardware\\samd\\1.7.10/libraries/Adafruit_TinyUSB_Arduino/src/arduino" -Os -D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_NEOKEYTRINKEY_M0 -DARDUINO_SAMD_ZERO -DARM_MATH_CM0PLUS -DUSB_VID=0x239A -DUSB_PID=0x80FF -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit\"" "-DUSB_PRODUCT=\"NeoKey Trinkey M0\"" "-IC:\\Users\\ruber\\AppData\\Local\\Arduino15\\packages\\adafruit\\hardware\\samd\\1.7.10/libraries/Adafruit_TinyUSB_Arduino/src/arduino" "-IC:\\Users\\ruber\\AppData\\Local\\Arduino15\\packages\\adafruit\\tools\\CMSIS\\5.4.0/CMSIS/Core/Include/" "-IC:\\Users\\ruber\\AppData\\Local\\Arduino15\\packages\\adafruit\\tools\\CMSIS\\5.4.0/CMSIS/DSP/Include/" "-IC:\\Users\\ruber\\AppData\\Local\\Arduino15\\packages\\adafruit\\tools\\CMSIS-Atmel\\1.2.2/CMSIS/Device/ATMEL/" "-IC:\\Users\\ruber\\AppData\\Local\\Arduino15\\packages\\adafruit\\hardware\\samd\\1.7.10\\cores\\arduino" "-IC:\\Users\\ruber\\AppData\\Local\\Arduino15\\packages\\adafruit\\hardware\\samd\\1.7.10\\variants\\neokeytrinkey_m0" "-ID:\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel" "-ID:\\Documents\\Arduino\\libraries\\Adafruit_FreeTouch_Library" "-ID:\\Documents\\Arduino\\libraries\\HID-Project\\src" "-IC:\\Users\\ruber\\AppData\\Local\\Arduino15\\packages\\adafruit\\hardware\\samd\\1.7.10\\libraries\\HID" "D:\\Documents\\Arduino\\libraries\\HID-Project\\src\\port\\samd.cpp" -o "C:\\Users\\ruber\\AppData\\Local\\Temp\\arduino_build_445876\\libraries\\HID-Project\\port\\samd.cpp.o"
D:\Documents\Arduino\libraries\HID-Project\src\port\samd.cpp: In function 'int USB_SendControl(void*, unsigned char)':
D:\Documents\Arduino\libraries\HID-Project\src\port\samd.cpp:8:1: error: no return statement in function returning non-void [-Werror=return-type]
    8 | }
      | ^
D:\Documents\Arduino\libraries\HID-Project\src\port\samd.cpp: In function 'int USB_SendControl(uint8_t, const void*, uint8_t)':
D:\Documents\Arduino\libraries\HID-Project\src\port\samd.cpp:12:1: error: no return statement in function returning non-void [-Werror=return-type]
   12 | }
      | ^
cc1plus.exe: some warnings being treated as errors
Multiple libraries were found for "Adafruit_NeoPixel.h"
 Used: D:\Documents\Arduino\libraries\Adafruit_NeoPixel
 Not used: D:\Documents\Arduino\libraries\arduino_439309
Using library Adafruit_NeoPixel at version 1.10.4 in folder: D:\Documents\Arduino\libraries\Adafruit_NeoPixel
Using library Adafruit_FreeTouch_Library at version 1.1.1 in folder: D:\Documents\Arduino\libraries\Adafruit_FreeTouch_Library
Using library HID-Project at version 2.8.2 in folder: D:\Documents\Arduino\libraries\HID-Project
Using library HID at version 1.0 in folder: C:\Users\ruber\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\libraries\HID
exit status 1
Error compiling for board Adafruit NeoKey Trinkey M0 (SAMD21).



I saw a reference to a needed change to the HID-Project .cpp, but couldn't find the original post. Any ideas? Thanks in Advance!

gadgeteer
 
Posts: 20
Joined: Wed Oct 24, 2012 10:50 am

Re: Neokey Trinkey + Arduino keyboard

by gadjet on Sun Apr 10, 2022 7:47 am

I have the same compiler issue as above with the Cap touch example.
Can anyone link to the mentioned fixes for the HID-Project.cpp file?

Arduino: 1.8.19 (Windows 10), Board: "Adafruit NeoKey Trinkey M0 (SAMD21), Small (-Os) (standard), Arduino, Off"

gadjet
 
Posts: 12
Joined: Mon Jan 21, 2019 6:51 pm

Re: Neokey Trinkey + Arduino keyboard

by SL1111 on Mon May 09, 2022 8:30 am

Has anyone been able to get the Neopixel/Touch example code working with Arduino? It seems like the touch and serial work but not the neopixels. It seems like the neopixels are on pin 6 (PA05 in schematics) so I think PIN_NEOPIXEL should be 5, however, I checked via serial output that NUM_NEOPIXEL = 1 and PIN_NEOPIXEL = 0:

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_NEOPIXEL, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800);


Also, I think I bricked 2 of my Neokey Trinkeys using PIN_NEOPIXEL = 4, probably a pin conflict with USB, so any advice on restoring? I tried hitting the reset button after the upload started but the serial port is still not recognized so it's a catch-22.

SL1111
 
Posts: 2
Joined: Mon May 09, 2022 8:00 am

Re: Neokey Trinkey + Arduino keyboard

by robhsaunders on Tue May 24, 2022 11:50 am

Hi,
I'm trying a Neo Trinkey with Arduino and having issues with the "KeyBoard" example code (and other examples). I'm not getting Touchpad 1 or the Leds to work. Seems like it's defective, any suggestions?

Thanks

robhsaunders
 
Posts: 3
Joined: Tue May 24, 2022 11:36 am

Re: Neokey Trinkey + Arduino keyboard

by SL1111 on Tue May 24, 2022 8:11 pm

Here's a keyboard example that works with my Neokey Trinkey with Arduino. It opens a command prompt on Windows and does a "dir c:\" when you touch the buttons. It's pretty much the original example with my own payload and I can confirm that it works.
Attachments
Example_Keyboard_2.ino
(2.63 KiB) Downloaded 1 time

SL1111
 
Posts: 2
Joined: Mon May 09, 2022 8:00 am

Re: Neokey Trinkey + Arduino keyboard

by robhsaunders on Wed May 25, 2022 10:37 am

robhsaunders wrote:Hi,
I'm trying a Neo Trinkey with Arduino and having issues with the "KeyBoard" example code (and other examples). I'm not getting Touchpad 1 or the Leds to work. Seems like it's defective, any suggestions?

Thanks


Got it working. Selected wrong board... BUT, I did still have errors compiling my NeoKey and was able to resolve errors by switching version of Adafruit SAMD Boards to 1.7.5

robhsaunders
 
Posts: 3
Joined: Tue May 24, 2022 11:36 am

Re: Neokey Trinkey + Arduino keyboard

by robhsaunders on Wed May 25, 2022 10:46 am

gadjet wrote:I have the same compiler issue as above with the Cap touch example.
Can anyone link to the mentioned fixes for the HID-Project.cpp file?

Arduino: 1.8.19 (Windows 10), Board: "Adafruit NeoKey Trinkey M0 (SAMD21), Small (-Os) (standard), Arduino, Off"


Try going to Board Manager and search for Adafruit SAMD Boards and change it to version 1.7.5. Then reselect the board and you'll notice it's the same but missing the "M0" in the name. "Adafruit NeoKey Trinkey (SAMD21)" vs "Adafruit NeoKey Trinkey M0 (SAMD21)

robhsaunders
 
Posts: 3
Joined: Tue May 24, 2022 11:36 am

Please be positive and constructive with your questions and comments.


cron