Search results

  1. R

    Button Press detector

    I am become coder /* Byte 1 Byte 2 Byte 3 Byte 4 7 - constant 1 7 - right paddle (2) 7 - bottom left yellow (3) 7 - 0 when Dpad pressed 6 - constant 1 6 - top right...
  2. R

    Button Press detector

    Thank you Shawn. I've applied the changes, but I'm currently resoldering my board so I wont have any tests until this evening.
  3. R

    Button Press detector

    Yep, UK English. Might it be a hardware related issue? Board currently wont run either of the [just press the button] scripts. My hamfistedness could well have carried over into the repairs for my previous hamfistedness. if (currHamfistedness >= prevHamfistedness) bork;
  4. R

    Button Press detector

    I dont know if these white text warnings matter, but during verify/upload, I'm ocassionally getting: C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\usb_keyboard.c: In function 'unicode_to_keycode': C:\Program Files...
  5. R

    Button Press detector

    Nice thank you Kurt. I go this up and running: Unfortunately I also discovered the reason it wasn't working before: Hamfistedness is Key to understanding quite a few 'unexplained' problems I feel. So, I'm going to have to work through everything from the beginning I think.
  6. R

    Button Press detector

    This is what USBView is seeing [Port8] : USB Composite Device Is Port User Connectable: yes Is Port Debug Capable: no Companion Port Number: 0 Companion Hub Symbolic Link Name: Protocols Supported: USB 1.1: yes USB 2.0...
  7. R

    Button Press detector

    This should get all the button(x, 1) lit up, right?
  8. R

    Button Press detector

    I've managed to get the code to the barest of bones: JUST PRESS THE BUTTON! I know TLC can read & process buttonstate and changes to buttonstate through Serial Print/Serial Monitor.. I've seen this in action. ... but I haven't seen TLC sending a buttonstate or changes to buttonstate to...
  9. R

    Button Press detector

    if ((wheelIdentified) and (wheelID == 3)) { // only for R383 wheel joyBtnState = (currBytes[3] & pos[0]) && !(currBytes[2] & 0x3c); // if hatswitch is pressed in the middle if (joyBtnState != prevJoyBtnState) Joystick.setButton(13, joyBtnState)...
  10. R

    Button Press detector

    Last revision before bed. I think I'm starting to understand how the button press/release loop works,... but obviously not well enough. "int R383Btn[]" has gone back in to give assignable button numbers "memcpy" to translate (bit2btn->R383btn) is in the 'setup', might it be better after the...
  11. R

    Button Press detector

    .... all of which leaves me with this: /* Byte 1 Byte 2 Byte 3 Byte 4 7 - constant 1 7 - right paddle (2) 7 - bottom left yellow (3) 7 - 0 when Dpad pressed 6 - constant 1...
  12. R

    Button Press detector

    I'm parsing #30 down to what seems like the bare bones. I've commented out the "Joystick_ Joystick" stuff, because that looks like it's trying to draw on a a DynamicHID/PluggableUSB resource from the author's modded library... whih doesn't work on the TLC #include <SPI.h> #include...
  13. R

    Button Press detector

    Thank you Kurt. So, [int bit2btn] isn't saying 'these are the buttons and their current values', it's just 'here are some buttons? Could I just use this from the Joystick Tutorial to set individual Byte/bit combos as a Joystick.button? Joystick.button(1, digitalRead(1))...
  14. R

    Button Press detector

    I can't get past bit2btn. That above post I found is literally the only relevant google return. Nothing in the Arduino reference. and "Joystick_ Joystick..."... what is that even doing?
  15. R

    Button Press detector

    Googled 'arduino, bit2btn' ... just turned up a goldmine: once again using: " Joystick_ Joystick( JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_GAMEPAD, 21, 1, // 21 buttons, 1 hatswitch false, false, false, false, false, false, false, false, false, false, false); " /* * Code by Insert...
  16. R

    Button Press detector

    There are 2 versions of this original sketch, both of which contain #include <SPI.h> #include <Joystick.h> Joystick_ Joystick( JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_GAMEPAD, 14, 0, false, false, false, false, false, false, false, false, false, false, false); const int...
  17. R

    Button Press detector

    /* Byte 1 * 7 - 1 * 6 - 0 * 5 - 0 * 4 - 0 * 3 - 0 * 2 - 1 * 1 - 0 * 0 - Button 6 * * Byte 2 * 7 - Button 2 * 6 - Button 5 * 5 - Button 9 * 4 - 1 = HatPush? * 3 - Button 7 * 2 - Button 13 * 1 - Button 8 * 0 - 1 = HatPush? * * Byte 3 * 7 - Button 3 * 6 -...
  18. R

    Button Press detector

    Thank you. Reading on SPI's, is 1000Hz vs 4000MHz going to make a difference to the functions? Is windows Power Management more liekly to step in an power off the device if there's a slwoer rate?
  19. R

    Button Press detector

    Here's the Pro-Micro sketch I'm working through. Having changed the 'slaveSelectPin', and deleted '#include <Joystick.h>' there's only a 'setButton' that comes back as an error. /* * sketch heavily based on code provided at: * April 2015 © blog@rr-m.org */ /* Also see comments from...
  20. R

    Button Press detector

    That works as well. I've no idea what AVR, MSBFirst/LSBFirst are though ¯\_(ツ)_/¯ If the CPHA/CPOL arent necessary then good riddance. I'm just working through one of those pro-micro sketches to see what I can modify/bring in here. Might also need to do some soldering, the poor board has...
  21. R

    Button Press detector

    Insert Homer Drooling mmmm functions! OK, cooking on gas. Pin 10, provides functional repsonses. 12 & 13 just read 0's or 1;'s with no change on button press. All the buttons are single momentary switches, but there is also a 5 way hat-like switch which doesn't register a 'push'. Up, Down...
  22. R

    Button Press detector

    Thaks Kurt. The pro-micro sketches I mentioned are from a 'Thrustmaster Conversion' search. Further along in that I also got a SPI sketch that prints 3 bytes of data. Free free to modify and use for your needs. This sketch and the documentation above provided "AS IS" under the BSD New...
  23. R

    Button Press detector

    Again, no change is being registered with that. Maybe my buttons are fried? I just did this: const int numButtons = 16; int lastButtonState; void setup() { Serial.begin(9600); for (int i=0; i<numButtons; i++) lastButtonState = digitalRead(INPUT); } void loop() { // read the value of...
  24. R

    Button Press detector

    Thank you. It compiles, but gives no output. I modified mine above a little bit const int numButtons = 16; void setup() { Serial.begin(38400); for (int i=0; i<numButtons; i++) pinMode(i, INPUT); } void loop() { for (int i=0; i<numButtons; i++) if (digitalRead(i) == HIGH) {...
  25. R

    Button Press detector

    Is there a DVM/DMM meter there that allows testing the button properties to the pin (and GND) as noted in p#11? I think this is what I wanted to use Teensy for. At least before I start trying to map functional outputs to them. But, no. All buttons are currently unpressed so neither of the...
  26. R

    Button Press detector

    With: const int numButtons = 16; void setup() { Serial.begin(38400); for (int i=0; i<numButtons; i++) pinMode(i, INPUT_PULLDOWN); } void loop() { for (int i=0; i<numButtons; i++) if (digitalRead(i) == INPUT) { Serial.println("Button is not pressed"); } else { Serial.println("Button...
  27. R

    Button Press detector

    I dont know how any of this works in detail . I didn't want to add any more resistance to the buttons, as the buttons are on a pre-populated board running thrrugh x number of Resistors of unknown values. I just wanted to see what was being read by the Teensy when a button was and wasn't being...
  28. R

    Button Press detector

    Changing: if (digitalRead(i) == HIGH) to, if (digitalRead(i) == INPUT) reverses the Serial Monitor output. When I do press buttons, nothing changes, same messages in Serial Monitor. What I'd like to see is something like Current State= Button1, Low Button2, High Button3, None etc...
  29. R

    Button Press detector

    FWIW: When this is uploaded, without pressing any of the buttons, the Serial Monitor prints: Button is not pressed (x15) Button is pressed (x1)
  30. R

    Button Press detector

    Thank you. The Teensy is part of a Thrustmaster/Sparco Steerring wheel button box. I bought a 'All in One' conversion kit that changes Thrustmaster 6-din output to USB, complete with approriate firmware/sketch I've had some USB bus issues, and thought this wheel might be a part of the problem...
  31. R

    Button Press detector

    I got this: const int numButtons = 16; void setup() { Serial.begin(38400); for (int i=0; i<numButtons; i++) pinMode(i, INPUT); } void loop() { for (int i=0; i<numButtons; i++) if (digitalRead(i) == HIGH) { Serial.println("Button is not...
  32. R

    Button Press detector

    Thank you. I've been playing with 'DigitalRead'. Is there a way to monitor all pins and report their states? I've also used Examples>Teensy>USB-Joystick>Complete. In Windows Game Controller, there is no output.
  33. R

    Button Press detector

    Hi, I've got a TeensyLC button box which used to output via USB as a game controller. And then I started tinkering before reading any manuals. It now doesn't output anything. It does work, I've been playing with example sketches to make sure I didn't completely ruin everything. Can I sketch...
Back
Top