Forum Rule: Always post complete source code & details to reproduce any issue!
Page 23 of 34 FirstFirst ... 13 21 22 23 24 25 33 ... LastLast
Results 551 to 575 of 850

Thread: T3.6 USB Host - Bluetooth

  1. #551
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,878
    @KurtE

    A lot cleaner layout for the test app. What I was doing was using the Serial.prints to make sure I referenced all the axes correctly for the TFT. Once I did that I just commented them out. Was planning on getting rid of them once we were finished - really don't need them if you have the display attached

    Want to make one more change to the HID Mouse though but can do that anytime.

  2. #552
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,872
    @mjs513 @defragster (@Paul if you are listening) ...

    I am somewhat torn at times on how much to restrict some of these possible Sample apps?

    That is currently this program and Packman... Are currently using my ili9341_t3n library which also relies on SPIN, which do not ship with Teensyduino...

    In some ways I don't think it is too much of an issue as the example shows where the code is up on github...

    But then part of me thinks that it would be good if they were self contained to "Teensyduino libraries"

    Obviously this is currently doable with T3.6 using ili9341_t3 library, however even then I/we are using features of _t3n which is not in _t3. Things like I am using Opaque font outputs. Currently it is not an issue but if you wish to output these fonts in more confined spaces you need the clipping rectangle... Awhile ago (2 years) I did a PR request to the main library that added a lot of this... (https://github.com/PaulStoffregen/ILI9341_t3/pull/41) But again PR is two years old...

    And the current incarnation of ili9341_t3 won't work with T4. This has already been mentioned in the T4 thread, but could make a rather speed neutered version of _t3 that works with T4 or ...

    So again wondering about thoughts of us using non-standard libraries?

  3. #553
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,878
    Quote Originally Posted by KurtE View Post
    @mjs513 @defragster (@Paul if you are listening) ...

    I am somewhat torn at times on how much to restrict some of these possible Sample apps?

    That is currently this program and Packman... Are currently using my ili9341_t3n library which also relies on SPIN, which do not ship with Teensyduino...

    In some ways I don't think it is too much of an issue as the example shows where the code is up on github...

    But then part of me thinks that it would be good if they were self contained to "Teensyduino libraries"

    Obviously this is currently doable with T3.6 using ili9341_t3 library, however even then I/we are using features of _t3n which is not in _t3. Things like I am using Opaque font outputs. Currently it is not an issue but if you wish to output these fonts in more confined spaces you need the clipping rectangle... Awhile ago (2 years) I did a PR request to the main library that added a lot of this... (https://github.com/PaulStoffregen/ILI9341_t3/pull/41) But again PR is two years old...

    And the current incarnation of ili9341_t3 won't work with T4. This has already been mentioned in the T4 thread, but could make a rather speed neutered version of _t3 that works with T4 or ...

    So again wondering about thoughts of us using non-standard libraries?
    I don't think there should be any issue with using non-standard libraries although it would be easier if it was already in Teensyduino but... I use so many other libraries other than the ones in Teensyduino its nuts.

    Ideally, if SPIN could be incorporated into ILI9341_t3n it would reduce the need to use an additional library.

    Maybe - ILI9341_t3n should replace ILI9341_t3, since the t3 version would need rework to get it up and running for the T4.

    Just my 2 cents on this one.

    Other than this example app not sure if we are going to have anymore so I wouldn't worry about restricting examples.

    Just for the record I am using ILI9341_t3n exclusively. A lot of nice features included that are not included in the _t3 version.

  4. #554
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,878
    @KurtE

    Found a way better way to do scrolling - just the way you want it: https://youtu.be/ylNigFH-VfM

    https://github.com/vitormhenrique/IL...r/ILI9341_t3.h

    They modified the t3 library to put in scrolling features, so get ready

  5. #555
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,660
    That scroll demo looks familiar - somebody did a private port - but never brought the code back or followed up - it allowed multiple windows - I found it cool with some minor issues …

    If you made that work it would be cool. I see KurtE is a contributor on that github.

  6. #556
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,878
    @KurtE and @defragster

    Here is the reference link on the forum: http://forum.pjrc.com/threads/26305-...lay%29-library

    Almost have it ported over going to give it a try and see what happens - easier than I thought it would be.

  7. #557
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,878
    @KurtE and @defragster

    Got it working but having one problem on the background color bleeding into the scroll background color - have to debug that but not sure I will spot that.. Any here is the almost working copy of the sketch and the lib mods:
    Attached Files Attached Files

  8. #558
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,660
    Quote Originally Posted by KurtE View Post
    @mjs513 @defragster (@Paul if you are listening) ...

    I am somewhat torn at times on how much to restrict some of these possible Sample apps?

    That is currently this program and Packman... Are currently using my ili9341_t3n library which also relies on SPIN, which do not ship with Teensyduino...
    ...
    The other day I did the T$ LTO build and found it to leave the T$ needing 15s reset - that was noted there and I had to dump everything to be sure it was at least observable in the build files if not reproducible - except the two libs zipped up to 2.5 MB and I couldn't put in the post … so that caused me grief hoping the github would still pull the same if it persisted when Paul wanted to see if it might point to an issue. The ili9341 may not have been part of the problem - but I didn't make time to try a simplified version just then. If it persists it may point to an issue we've seen more intermittently. But again that may change when the 1062 comes online and the linker mapping gets changed to final form and refined.

    Would be nice to have everything merged and one great driver - but so much change and versions and other soft/hardware dev work going on it is tough . . .

  9. #559
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,872
    Hi @mjs513 and @defragster - (and of course others)

    Sorry was gone for a few hours...

    I pushed up my current version of your digitizer code.

    Note: I Hacked this version for the Intuos tablet that I have to grab more of the fields the Usages that were being returned... In particular:
    Code:
    	if (usage_page == 0xff0D) {
    		if (usage >= 0 && usage < 0x138) { //at least to start
    			switch (usage) {
    			  case 0x130: 
    				mouseX = value;
    				break;
    			  case 0x131:
    				mouseY = value;
    				break;
    			  case 0x132: // Apple uses this for horizontal scroll
    				wheelH = value;
    				break;
    			  case 0x138:
    				wheel = value;
    				break;
    			case 0x30: digiAxes[0] = value; break;
    			case 0x32: digiAxes[1] = value; break;
    			case 0x36: digiAxes[2] = value; break;
    			case 0x42: digiAxes[3] = value; break;
    			case 0x44: digiAxes[4] = value; break;
    			case 0x5A: digiAxes[5] = value; break;
    			case 0x5B: digiAxes[6] = value; break;
    			case 0x5C: digiAxes[7] = value; break;
    			case 0x77: digiAxes[8] = value; break;
    			}
    			//digiAxes[usage & 0xf] = value;
    		} else if (usage >= 0x910 && usage <= 0x91f) {
    			if (value == 0) {
    				buttons &= ~(1 << (usage - 0x910));
    			} else {
    				buttons |= (1 << (usage - 0x910));
    			}
    		}
    	}
    And with this: Updated the sketch to output these fields.
    Code:
    //=============================================================================
    // Simple test of USB Host Mouse/Tablet/Joystick viewer on ili9341 display
    //
    // Currently requires the libraries
    //    ili9341_t3n that can be located: https://github.com/KurtE/ILI9341_t3n
    //    spin: https://github.com/KurtE/SPIN
    //
    // Teensy 3.6 Pins
    //   8 = RST
    //   9 = D/C
    //  10 = CS
    //
    // Teensy 4.0 Beta Pins
    //  23 = RST (Marked MCLK on T4 beta breakout)
    //  10 = CS (Marked CS)
    //  9 = DC  (Marked MEMCS)
    //
    // This example is in the public domain
    //=============================================================================
    
    #include "USBHost_t36.h"
    #include <ili9341_t3n_font_Arial.h>
    
    //=============================================================================
    // Connection configuration of ILI9341 LCD TFT
    //=============================================================================
    #if defined(__MK66FX1M0__)
    #define TFT_RST 8
    #define TFT_DC 9
    #define TFT_CS 10
    #elif defined(__IMXRT1052__) || defined(__IMXRT1062__)
    // On Teensy 4 beta with Paul's breakout out:
    // Using pins (MOSI, MISO, SCK which are labeled on Audio board breakout location
    // which are not in the Normal processor positions
    // Also DC=10(CS), CS=9(BCLK) and RST 23(MCLK)
    #define TFT_RST 23
    #define TFT_DC 9
    #define TFT_CS 10
    #else
    #error "This example App will only work with Teensy 3.6 or Teensy 4."
    #endif
    ILI9341_t3n tft = ILI9341_t3n(TFT_CS, TFT_DC, TFT_RST);
    
    //=============================================================================
    // USB Host Ojbects
    //=============================================================================
    USBHost myusb;
    USBHub hub1(myusb);
    USBHub hub2(myusb);
    USBHIDParser hid1(myusb);
    USBHIDParser hid2(myusb);
    USBHIDParser hid3(myusb);
    USBHIDParser hid4(myusb);
    USBHIDParser hid5(myusb);
    MouseController mouse(myusb);
    DigitizerController tablet(myusb);
    JoystickController joystick(myusb);
    //BluetoothController bluet(myusb, true, "0000");   // Version does pairing to device
    BluetoothController bluet(myusb);   // version assumes it already was paired
    RawHIDController rawhid2(myusb);
    
    // Lets only include in the lists The most top level type devices we wish to show information for.
    USBDriver *drivers[] = {&joystick};
    #define CNT_DEVICES (sizeof(drivers)/sizeof(drivers[0]))
    const char * driver_names[CNT_DEVICES] = {"Joystick(device)"};
    bool driver_active[CNT_DEVICES] = {false};
    
    // Lets also look at HID Input devices
    USBHIDInput *hiddrivers[] = {&tablet, &joystick, &mouse, &rawhid2};
    #define CNT_HIDDEVICES (sizeof(hiddrivers)/sizeof(hiddrivers[0]))
    const char * hid_driver_names[CNT_HIDDEVICES] = {"tablet", "joystick", "mouse", "RawHid2"};
    bool hid_driver_active[CNT_HIDDEVICES] = {false, false};
    
    BTHIDInput *bthiddrivers[] = {&joystick, &mouse};
    #define CNT_BTHIDDEVICES (sizeof(bthiddrivers)/sizeof(bthiddrivers[0]))
    const char * bthid_driver_names[CNT_HIDDEVICES] = {"joystick", "mouse"};
    bool bthid_driver_active[CNT_HIDDEVICES] = {false, false};
    
    //=============================================================================
    // Other state variables.
    //=============================================================================
    
    // Save away values for buttons, x, y, wheel, wheelh
    int buttons_cur = 0;
    int x_cur = 0,
        y_cur = 0,
        z_cur = 0;
    int x2_cur = 0,
        y2_cur = 0,
        z2_cur = 0;
    int wheel_cur = 0;
    int wheelH_cur = 0;
    int axis_cur[10];
    
    
    int user_axis[64];
    uint32_t buttons_prev = 0;
    uint32_t buttons;
    
    bool show_changed_only = false;
    bool new_device_detected = false;
    int16_t y_position_after_device_info = 0;
    
    uint8_t joystick_left_trigger_value = 0;
    uint8_t joystick_right_trigger_value = 0;
    uint64_t joystick_full_notify_mask = (uint64_t) - 1;
    
    //=============================================================================
    // Setup
    //=============================================================================
    void setup()
    {
      Serial1.begin(2000000);
      while (!Serial && millis() < 3000) ; // wait for Arduino Serial Monitor
      Serial.println("\n\nUSB Host Testing");
      myusb.begin();
      rawhid2.attachReceive(OnReceiveHidData);
    
    
      tft.begin();
      delay(100);
      tft.setRotation(3); // 180
      delay(100);
      tft.fillScreen(ILI9341_BLACK);
      tft.setTextColor(ILI9341_YELLOW);
      tft.setTextSize(2);
      tft.println("Waiting for Mouse or Joystick...");
    }
    
    
    //=============================================================================
    // Loop
    //=============================================================================
    void loop()
    {
      myusb.Task();
    
      // Update the display with
      UpdateActiveDeviceInfo();
    
      // Now lets try displaying Tablet data
      ProcessTabletData();
    
      // And joystick data
      ProcessJoystickData();
    
      // Process Mouse Data
      ProcessMouseData();
    }
    
    
    //=============================================================================
    // UpdateActiveDeviceInfo
    //=============================================================================
    void UpdateActiveDeviceInfo() {
      // First see if any high level devices
      for (uint8_t i = 0; i < CNT_DEVICES; i++) {
        if (*drivers[i] != driver_active[i]) {
          if (driver_active[i]) {
            Serial.printf("*** Device %s - disconnected ***\n", driver_names[i]);
            driver_active[i] = false;
          } else {
            new_device_detected = true;
            Serial.printf("*** Device %s %x:%x - connected ***\n", driver_names[i], drivers[i]->idVendor(), drivers[i]->idProduct());
            driver_active[i] = true;
            tft.fillScreen(ILI9341_BLACK);  // clear the screen.
            tft.setCursor(0, 0);
            tft.setTextColor(ILI9341_YELLOW);
            tft.setFont(Arial_12);
            tft.printf("Device %s %x:%x\n", driver_names[i], drivers[i]->idVendor(), drivers[i]->idProduct());
    
            const uint8_t *psz = drivers[i]->manufacturer();
            if (psz && *psz) tft.printf("  manufacturer: %s\n", psz);
            psz = drivers[i]->product();
            if (psz && *psz) tft.printf("  product: %s\n", psz);
            psz = drivers[i]->serialNumber();
            if (psz && *psz) tft.printf("  Serial: %s\n", psz);
          }
        }
      }
      // Then Hid Devices
      for (uint8_t i = 0; i < CNT_HIDDEVICES; i++) {
        if (*hiddrivers[i] != hid_driver_active[i]) {
          if (hid_driver_active[i]) {
            Serial.printf("*** HID Device %s - disconnected ***\n", hid_driver_names[i]);
            hid_driver_active[i] = false;
          } else {
            new_device_detected = true;
            Serial.printf("*** HID Device %s %x:%x - connected ***\n", hid_driver_names[i], hiddrivers[i]->idVendor(), hiddrivers[i]->idProduct());
            hid_driver_active[i] = true;
            tft.fillScreen(ILI9341_BLACK);  // clear the screen.
            tft.setCursor(0, 0);
            tft.setTextColor(ILI9341_YELLOW);
            tft.setFont(Arial_12);
            tft.printf("HID Device %s %x:%x\n", hid_driver_names[i], hiddrivers[i]->idVendor(), hiddrivers[i]->idProduct());
    
            const uint8_t *psz = hiddrivers[i]->manufacturer();
            if (psz && *psz) tft.printf("  manufacturer: %s\n", psz);
            psz = hiddrivers[i]->product();
            if (psz && *psz) tft.printf("  product: %s\n", psz);
            psz = hiddrivers[i]->serialNumber();
            if (psz && *psz) tft.printf("  Serial: %s\n", psz);
          }
        }
      }
    
      // Then Bluetooth devices
      for (uint8_t i = 0; i < CNT_BTHIDDEVICES; i++) {
        if (*bthiddrivers[i] != bthid_driver_active[i]) {
          if (bthid_driver_active[i]) {
            Serial.printf("*** BTHID Device %s - disconnected ***\n", hid_driver_names[i]);
            hid_driver_active[i] = false;
          } else {
            new_device_detected = true;
            Serial.printf("*** BTHID Device %s %x:%x - connected ***\n", hid_driver_names[i], hiddrivers[i]->idVendor(), hiddrivers[i]->idProduct());
            bthid_driver_active[i] = true;
            tft.fillScreen(ILI9341_BLACK);  // clear the screen.
            tft.setCursor(0, 0);
            tft.setTextColor(ILI9341_YELLOW);
            tft.setFont(Arial_12);
            tft.printf("Bluetooth Device %s %x:%x\n", bthid_driver_names[i], bthiddrivers[i]->idVendor(), bthiddrivers[i]->idProduct());
    
            const uint8_t *psz = bthiddrivers[i]->manufacturer();
            if (psz && *psz) tft.printf("  manufacturer: %s\n", psz);
            psz = bthiddrivers[i]->product();
            if (psz && *psz) tft.printf("  product: %s\n", psz);
            psz = bthiddrivers[i]->serialNumber();
            if (psz && *psz) tft.printf("  Serial: %s\n", psz);
          }
        }
      }
    }
    
    //=============================================================================
    // ProcessTabletData
    //=============================================================================
    void ProcessTabletData() {
      if (tablet.available()) {
        if (new_device_detected) {
          // Lets display the titles.
          int16_t x;
          tft.getCursor(&x, &y_position_after_device_info);
          tft.setTextColor(ILI9341_YELLOW);
          tft.printf("Buttons:\nX:\nY:\nWheel:\nWheel H:\nAxis:");
          new_device_detected = false;
        }
        bool something_changed = false;
        if (tablet.getButtons() != buttons_cur) {
          buttons_cur = tablet.getButtons();
          something_changed = true;
        }
        if (tablet.getMouseX() != x_cur) {
          x_cur = tablet.getMouseX();
          something_changed = true;
        }
        if (tablet.getMouseY() != y_cur) {
          y_cur = tablet.getMouseY();
          something_changed = true;
        }
        if (tablet.getWheel() != wheel_cur) {
          wheel_cur = tablet.getWheel();
          something_changed = true;
        }
        if (tablet.getWheelH() != wheelH_cur) {
          wheelH_cur = tablet.getWheelH();
          something_changed = true;
        }
        // BUGBUG:: play with some Axis...
        for (uint8_t i = 0; i < 10; i++) {
          int axis = tablet.getAxis(i);
          if (axis != axis_cur[i]) {
            axis_cur[i] = axis;
            something_changed = true;
          }
        }
    
        if (something_changed) {
    #define TABLET_DATA_X 100
          int16_t x, y2;
          unsigned char line_space = Arial_12.line_space;
          tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);
          //tft.setTextDatum(BR_DATUM);
          int16_t y = y_position_after_device_info;
          tft.setCursor(TABLET_DATA_X, y);
          tft.printf("%d(%x)", buttons_cur, buttons_cur);
          tft.getCursor(&x, &y2);
          tft.fillRect(x, y, 320, line_space, ILI9341_BLACK);
    
          y += line_space; OutputNumberField(TABLET_DATA_X, y, x_cur, 320);
          y += line_space; OutputNumberField(TABLET_DATA_X, y, y_cur, 320);
          y += line_space; OutputNumberField(TABLET_DATA_X, y, wheel_cur, 320);
          y += line_space; OutputNumberField(TABLET_DATA_X, y, wheelH_cur, 320);
    
          // Output other Axis data
          for (uint8_t i = 0; i < 9; i += 3) {
            y += line_space;
            OutputNumberField(TABLET_DATA_X, y, axis_cur[i], 75);
            OutputNumberField(TABLET_DATA_X + 75, y, axis_cur[i + 1], 75);
            OutputNumberField(TABLET_DATA_X + 150, y, axis_cur[i + 2], 75);
          }
    
        }
        tablet.digitizerDataClear();
      }
    }
    //=============================================================================
    // OutputNumberField
    //=============================================================================
    void OutputNumberField(int16_t x, int16_t y, int val, int16_t field_width) {
      int16_t x2, y2;
      tft.setCursor(x, y);
      tft.print(val, DEC); tft.getCursor(&x2, &y2);
      tft.fillRect(x2, y, field_width - (x2-x), Arial_12.line_space, ILI9341_BLACK);
    }
    
    //=============================================================================
    // ProcessMouseData
    //=============================================================================
    void ProcessMouseData() {
      if (mouse.available()) {
        if (new_device_detected) {
          // Lets display the titles.
          int16_t x;
          tft.getCursor(&x, &y_position_after_device_info);
          tft.setTextColor(ILI9341_YELLOW);
          tft.printf("Buttons:\nX:\nY:\nWheel:\nWheel H:");
          new_device_detected = false;
        }
    
        bool something_changed = false;
        if (mouse.getButtons() != buttons_cur) {
          buttons_cur = mouse.getButtons();
          something_changed = true;
        }
        if (mouse.getMouseX() != x_cur) {
          x_cur = mouse.getMouseX();
          something_changed = true;
        }
        if (mouse.getMouseY() != y_cur) {
          y_cur = mouse.getMouseY();
          something_changed = true;
        }
        if (mouse.getWheel() != wheel_cur) {
          wheel_cur = mouse.getWheel();
          something_changed = true;
        }
        if (mouse.getWheelH() != wheelH_cur) {
          wheelH_cur = mouse.getWheelH();
          something_changed = true;
        }
        if (something_changed) {
    #define MOUSE_DATA_X 100
          int16_t x, y2;
          unsigned char line_space = Arial_12.line_space;
          tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);
          //tft.setTextDatum(BR_DATUM);
          int16_t y = y_position_after_device_info;
          tft.setCursor(TABLET_DATA_X, y);
          tft.printf("%d(%x)", buttons_cur, buttons_cur);
          tft.getCursor(&x, &y2);
          tft.fillRect(x, y, 320, line_space, ILI9341_BLACK);
    
          y += line_space; OutputNumberField(MOUSE_DATA_X, y, x_cur, 320);
          y += line_space; OutputNumberField(MOUSE_DATA_X, y, y_cur, 320);
          y += line_space; OutputNumberField(MOUSE_DATA_X, y, wheel_cur, 320);
          y += line_space; OutputNumberField(MOUSE_DATA_X, y, wheelH_cur, 320);
        }
    
        mouse.mouseDataClear();
      }
    }
    
    //=============================================================================
    // ProcessJoystickData
    //=============================================================================
    void ProcessJoystickData() {
      if (joystick.available()) {
        uint64_t axis_mask = joystick.axisMask();
        uint64_t axis_changed_mask = joystick.axisChangedMask();
        Serial.print("Joystick: buttons = ");
        buttons = joystick.getButtons();
        Serial.print(buttons, HEX);
        //Serial.printf(" AMasks: %x %x:%x", axis_mask, (uint32_t)(user_axis_mask >> 32), (uint32_t)(user_axis_mask & 0xffffffff));
        //Serial.printf(" M: %lx %lx", axis_mask, joystick.axisChangedMask());
        if (show_changed_only) {
          for (uint8_t i = 0; axis_changed_mask != 0; i++, axis_changed_mask >>= 1) {
            if (axis_changed_mask & 1) {
              Serial.printf(" %d:%d", i, joystick.getAxis(i));
            }
          }
        } else {
          for (uint8_t i = 0; axis_mask != 0; i++, axis_mask >>= 1) {
            if (axis_mask & 1) {
              Serial.printf(" %d:%d", i, joystick.getAxis(i));
            }
          }
        }
        for (uint8_t i = 0; i < 64; i++) {
          user_axis[i] = joystick.getAxis(i);
        }
        uint8_t ltv;
        uint8_t rtv;
        switch (joystick.joystickType()) {
          default:
            break;
          case JoystickController::PS4:
            ltv = joystick.getAxis(3);
            rtv = joystick.getAxis(4);
            if ((ltv != joystick_left_trigger_value) || (rtv != joystick_right_trigger_value)) {
              joystick_left_trigger_value = ltv;
              joystick_right_trigger_value = rtv;
              joystick.setRumble(ltv, rtv);
            }
            break;
    
          case JoystickController::PS3:
            ltv = joystick.getAxis(18);
            rtv = joystick.getAxis(19);
            if ((ltv != joystick_left_trigger_value) || (rtv != joystick_right_trigger_value)) {
              joystick_left_trigger_value = ltv;
              joystick_right_trigger_value = rtv;
              joystick.setRumble(ltv, rtv, 50);
            }
            break;
    
          case JoystickController::XBOXONE:
          case JoystickController::XBOX360:
            ltv = joystick.getAxis(4);
            rtv = joystick.getAxis(5);
            if ((ltv != joystick_left_trigger_value) || (rtv != joystick_right_trigger_value)) {
              joystick_left_trigger_value = ltv;
              joystick_right_trigger_value = rtv;
              joystick.setRumble(ltv, rtv);
              Serial.printf(" Set Rumble %d %d", ltv, rtv);
            }
            break;
        }
        if (buttons != buttons_cur) {
          if (joystick.joystickType() == JoystickController::PS3) {
            joystick.setLEDs((buttons >> 12) & 0xf); //  try to get to TRI/CIR/X/SQuare
          } else {
            uint8_t lr = (buttons & 1) ? 0xff : 0;
            uint8_t lg = (buttons & 2) ? 0xff : 0;
            uint8_t lb = (buttons & 4) ? 0xff : 0;
            joystick.setLEDs(lr, lg, lb);
          }
          buttons_cur = buttons;
        }
        Serial.println();
        TFT_joystick();
        joystick.joystickDataClear();
      }
    }
    
    
    //=============================================================================
    // TFT_joystick
    //=============================================================================
    void TFT_joystick()
    {
      tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);
      tft.drawString("BUTTONS", 100, 100);
      if (buttons == 0) {
        tft.drawString(".........", 180, 100);
        tft.drawNumber(buttons_prev, 180, 100);
      } else {
        tft.drawNumber(buttons, 180, 100);
      }
    
      tft.drawString("X: ", 60, 120);
      if (user_axis[0] == x_cur) {
        tft.drawString(".........", 80, 120);
        tft.drawNumber(x_cur, 80, 120);
      } else {
        tft.drawNumber(user_axis[0], 80, 120);
      }
      x_cur = user_axis[0];
    
      tft.drawString("Y: ", 60, 140);
      if (user_axis[1] == y_cur) {
        tft.drawString(".........", 80, 140);
        tft.drawNumber(y_cur, 80, 140);
      } else {
        tft.drawNumber(user_axis[1], 80, 140);
      }
      y_cur = user_axis[1];
    
      tft.drawString("Hat: ", 40, 180);
      if (user_axis[9] == wheel_cur) {
        tft.drawString(".........", 80, 180);
        tft.drawNumber(wheel_cur, 80, 180);
      } else {
        tft.drawNumber(user_axis[9], 80, 180);
      }
      wheel_cur = user_axis[9];
    
      //Gamepads
      tft.drawString("X2: ", 160, 120);
      if (user_axis[2] == x_cur) {
        tft.drawString(".........", 190, 120);
        tft.drawNumber(x_cur, 190, 120);
      } else {
        tft.drawNumber(user_axis[2], 190, 120);
      }
      x2_cur = user_axis[2];
    
    
      switch (joystick.joystickType()) {
        default:
          tft.drawString("Z: ", 60, 160);
          if (user_axis[5] == z_cur) {
            tft.drawString(".........", 80, 160);
            tft.drawNumber(z_cur, 80, 140);
          } else {
            tft.drawNumber(user_axis[5], 80, 160);
          }
          z_cur = user_axis[5];
          break;
        case JoystickController::PS4:
          tft.drawString("Y2: ", 160, 140);
          if (user_axis[5] == y2_cur) {
            tft.drawString(".........", 190, 140);
            tft.drawNumber(y2_cur, 190, 120);
          } else {
            tft.drawNumber(user_axis[5], 190, 140);
          }
          y2_cur = user_axis[5];
          break;
        case JoystickController::PS3:
          tft.drawString("Y2: ", 160, 140);
          if (user_axis[5] == y2_cur) {
            tft.drawString(".........", 190, 140);
            tft.drawNumber(y2_cur, 190, 140);
          } else {
            tft.drawNumber(user_axis[5], 190, 140);
          }
          y2_cur = user_axis[5];
          break;
        case JoystickController::XBOXONE:
        case JoystickController::XBOX360:
          tft.drawString("Y2: ", 160, 160);
          if (user_axis[5] == y2_cur) {
            tft.drawString(".........", 190, 160);
            tft.drawNumber(y2_cur, 190, 160);
          } else {
            tft.drawNumber(user_axis[5], 190, 160);
          }
          y2_cur = user_axis[5];
          break;
      }
    }
    
    //=============================================================================
    // ProcessMouseData
    //=============================================================================
    bool OnReceiveHidData(uint32_t usage, const uint8_t *data, uint32_t len) {
      // Called for maybe both HIDS for rawhid basic test.  One is for the Teensy
      // to output to Serial. while still having Raw Hid...
      if (usage == 0xffc90004) {
        // Lets trim off trailing null characters.
        while ((len > 0) && (data[len - 1] == 0)) {
          len--;
        }
        if (len) {
          //Serial.print("RawHid Serial: ");
          //Serial.write(data, len);
        }
      } else {
        //Serial.print("RawHIDx data: ");
        //Serial.println(usage, HEX);
        uint8_t len1 = len;
    
        for (int j = 0; j < len; j++) {
          user_axis[j] = data[j];
        }
        /*
            while (len) {
              uint8_t cb = (len > 16) ? 16 : len;
              const uint8_t *p = data;
              uint8_t i;
              for (i = 0; i < cb; i++) {
                Serial.printf("%02x ", *p++);
              }
              Serial.print(": ");
              for (i = 0; i < cb; i++) {
                Serial.write(((*data >= ' ') && (*data <= '~')) ? *data : '.');
                data++;
              }
              len -= cb;
              Serial.println();
            }
        */
      }
    
      //for (uint8_t i = 0; i<9; i++) {
      //Serial.printf(" %d:%d", i, user_axis[i]);
      //}
      //Serial.println();
      //Serial.print("Mouse: buttons = ");
      //Serial.print(user_axis[3]);
      //Serial.print(",  mouseX = ");
      //Serial.print(user_axis[4]);
      //Serial.print(",  mouseY = ");
      //Serial.print(user_axis[5]);
      //Serial.println();
    
      bool something_changed = false;
      if (user_axis[3] != buttons_cur) {
        buttons_cur = user_axis[3];
        something_changed = true;
      }
      if (user_axis[4] != x_cur) {
        x_cur = user_axis[4];
        something_changed = true;
      }
      if (user_axis[5] != y_cur) {
        y_cur = user_axis[5];
        something_changed = true;
      }
      if (tablet.getWheel() != wheel_cur) {
        wheel_cur = 0;
        something_changed = true;
      }
      if (tablet.getWheelH() != wheelH_cur) {
        wheelH_cur = 0;
        something_changed = true;
      }
      if (something_changed) {
        tft.fillRect(45, 197, 240, 20, ILI9341_RED);
        tft.drawNumber(buttons_cur, 50, 200);
        tft.drawNumber(x_cur, 100, 200);
        tft.drawNumber(y_cur, 150, 200);
        tft.drawNumber(wheel_cur, 200, 200);
        tft.drawNumber(wheelH_cur, 250, 200);
      }
      return true;
    }
    And I am finding that With some of these:

    Code:
    			
    So the getAxis calls for this are showing something like:
    0 - Maybe how much pressure is on the tablet
    1 - pen is really close to tablet
    2 - Pen is pretty close
    3 - Pen is touching tablet
    4 - lower button on pen is pressed
    5 - higher button on pen is pressed
    6-8?  Only when pen is near...
    I was thinking about going ahead and add this app as example? Also wondering about updating the Joystick area to use my field output code in here which left justify all numbers and then erase everything to right of it in field... So don't have to do multiple writes...

    Will have to look at some of the scrolling stuff. I know I played with some of it a long time ago, but don't remember much

  10. #560
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,878
    @KurtE and @defragster

    I will have to check out the changes give it try.

    Been playing with scrolling and think it would be a great to incorporate - only have to use print and println in the scroll area. The zip I attached works fine except for the black bleed through as it scrolls - especially if the text is large. Just to make it easier here is what I incorporated (I extracted just the scroll stuff from the other Lib):
    Code:
    	void setScrollTextArea(int16_t x, int16_t y, int16_t w, int16_t h);
    	void setScrollBackgroundColor(uint16_t color);
    	void enableScroll(void);
    	void disableScroll(void);
    	void scrollTextArea(uint8_t scrollSize);
    	void resetScrollBackgroundColor(uint16_t color);
    
     protected:
    	int16_t scroll_x, scroll_y, scroll_width, scroll_height;
    	uint16_t textcolor, textbgcolor, scrollbgcolor;
    	boolean wrap, scrollEnable,isWritingScrollArea; // If set, 'wrap' text at right edge of display
    
    
    ----------------------------------------------
    
    size_t ILI9341_t3::write(uint8_t c)
    {
    	if (font) {
    		if (c == '\n') {
    			cursor_y += font->line_space;
    			if(scrollEnable && isWritingScrollArea){
    				cursor_x  = scroll_x;
    			}else{
    				cursor_x  = 0;
    			}
    		} else {
    			drawFontChar(c);
    		}
    	} else {
    		if (c == '\n') {
    			cursor_y += textsize*8;
    			if(scrollEnable && isWritingScrollArea){
    				cursor_x  = scroll_x;
    			}else{
    				cursor_x  = 0;
    			}
    		} else if (c == '\r') {
    			// skip em
    		} else {
    			if(scrollEnable && isWritingScrollArea && (cursor_y > (scroll_y+scroll_height - textsize*8))){
    				scrollTextArea(textsize*8);
    				cursor_y -= textsize*8;
    				cursor_x = scroll_x;
    			}
    			drawChar(cursor_x, cursor_y, c, textcolor, textbgcolor, textsize);
    			cursor_x += textsize*6;
    			if(wrap && scrollEnable && isWritingScrollArea && (cursor_x > (scroll_x+scroll_width - textsize*6))){
    				cursor_y += textsize*8;
    				cursor_x = scroll_x;
    			}
    			else if (wrap && (cursor_x > (_width - textsize*6))) {
    				cursor_y += textsize*8;
    				cursor_x = 0;
    			}
    		}
    	}
    	return 1;
    }
    
    void ILI9341_t3::drawFontChar(unsigned int c)
    {
    	uint32_t bitoffset;
    	const uint8_t *data;
    
    	//Serial.printf("drawFontChar %d\n", c);
    
    	if (c >= font->index1_first && c <= font->index1_last) {
    		bitoffset = c - font->index1_first;
    		bitoffset *= font->bits_index;
    	} else if (c >= font->index2_first && c <= font->index2_last) {
    		bitoffset = c - font->index2_first + font->index1_last - font->index1_first + 1;
    		bitoffset *= font->bits_index;
    	} else if (font->unicode) {
    		return; // TODO: implement sparse unicode
    	} else {
    		return;
    	}
    	//Serial.printf("  index =  %d\n", fetchbits_unsigned(font->index, bitoffset, font->bits_index));
    	data = font->data + fetchbits_unsigned(font->index, bitoffset, font->bits_index);
    
    	uint32_t encoding = fetchbits_unsigned(data, 0, 3);
    	if (encoding != 0) return;
    	uint32_t width = fetchbits_unsigned(data, 3, font->bits_width);
    	bitoffset = font->bits_width + 3;
    	uint32_t height = fetchbits_unsigned(data, bitoffset, font->bits_height);
    	bitoffset += font->bits_height;
    	//Serial.printf("  size =   %d,%d\n", width, height);
    
    	int32_t xoffset = fetchbits_signed(data, bitoffset, font->bits_xoffset);
    	bitoffset += font->bits_xoffset;
    	int32_t yoffset = fetchbits_signed(data, bitoffset, font->bits_yoffset);
    	bitoffset += font->bits_yoffset;
    	//Serial.printf("  offset = %d,%d\n", xoffset, yoffset);
    
    	uint32_t delta = fetchbits_unsigned(data, bitoffset, font->bits_delta);
    	bitoffset += font->bits_delta;
    	//Serial.printf("  delta =  %d\n", delta);
    
    	//Serial.printf("  cursor = %d,%d\n", cursor_x, cursor_y);
    
    	// horizontally, we draw every pixel, or none at all
    	if (cursor_x < 0) cursor_x = 0;
    	int32_t origin_x = cursor_x + xoffset;
    	if (origin_x < 0) {
    		cursor_x -= xoffset;
    		origin_x = 0;
    	}
    	if (origin_x + (int)width > _width) {
    		if (!wrap) return;
    		origin_x = 0;
    		if (xoffset >= 0) {
    			cursor_x = 0;
    		} else {
    			cursor_x = -xoffset;
    		}
    		cursor_y += font->line_space;
    	}
    	if(wrap && scrollEnable && isWritingScrollArea && ((origin_x + (int)width) > (scroll_x+scroll_width))){
        	origin_x = 0;
    		if (xoffset >= 0) {
    			cursor_x = scroll_x;
    		} else {
    			cursor_x = -xoffset;
    		}
    		cursor_y += font->line_space;
        }
    	
    	if(scrollEnable && isWritingScrollArea && (cursor_y > (scroll_y+scroll_height - font->cap_height))){
    		scrollTextArea(font->line_space);
    		cursor_y -= font->line_space;
    		cursor_x = scroll_x;
    	} 
    	if (cursor_y >= _height) return;
    	///cursor_x += delta;  ???????????????????????????????????????????????????????????
    
    	// vertically, the top and/or bottom can be clipped
    	int32_t origin_y = cursor_y + font->cap_height - height - yoffset;
    	//Serial.printf("  origin = %d,%d\n", origin_x, origin_y);
    
    	// TODO: compute top skip and number of lines
    	int32_t linecount = height;
    	//uint32_t loopcount = 0;
    	uint32_t y = origin_y;
    	while (linecount) {
    		//Serial.printf("    linecount = %d\n", linecount);
    		uint32_t b = fetchbit(data, bitoffset++);
    		if (b == 0) {
    			//Serial.println("    single line");
    			uint32_t x = 0;
    			do {
    				uint32_t xsize = width - x;
    				if (xsize > 32) xsize = 32;
    				uint32_t bits = fetchbits_unsigned(data, bitoffset, xsize);
    				drawFontBits(bits, xsize, origin_x + x, y, 1);
    				bitoffset += xsize;
    				x += xsize;
    			} while (x < width);
    			y++;
    			linecount--;
    		} else {
    			uint32_t n = fetchbits_unsigned(data, bitoffset, 3) + 2;
    			bitoffset += 3;
    			uint32_t x = 0;
    			do {
    				uint32_t xsize = width - x;
    				if (xsize > 32) xsize = 32;
    				//Serial.printf("    multi line %d\n", n);
    				uint32_t bits = fetchbits_unsigned(data, bitoffset, xsize);
    				drawFontBits(bits, xsize, origin_x + x, y, n);
    				bitoffset += xsize;
    				x += xsize;
    			} while (x < width);
    			y += n;
    			linecount -= n;
    		}
    		//if (++loopcount > 100) {
    			//Serial.println("     abort draw loop");
    			//break;
    		//}
    	}
    }
    
    void ILI9341_t3::setCursor(int16_t x, int16_t y) {
    	if (x < 0) x = 0;
    	else if (x >= _width) x = _width - 1;
    	cursor_x = x;
    	if (y < 0) y = 0;
    	else if (y >= _height) y = _height - 1;
    	cursor_y = y;
    
    	if(x>=scroll_x && x<=(scroll_x+scroll_width) && y>=scroll_y && y<=(scroll_y+scroll_height)){
    		isWritingScrollArea	= true;
    	} else {
    		isWritingScrollArea = false;
    	}
    }
    
    void ILI9341_t3::scrollTextArea(uint8_t scrollSize){
    	uint16_t awColors[scroll_width];
    	for (int y=scroll_y+scrollSize; y < (scroll_y+scroll_height); y++) { 
    		readRect(scroll_x, y, scroll_width, 1, awColors); 
        writeRect(scroll_x, y-scrollSize, scroll_width, 1, awColors);  
      }
      fillRect(scroll_x, (scroll_y+scroll_height)-scrollSize, scroll_width, scrollSize, scrollbgcolor);
    }
    
    void ILI9341_t3::setScrollTextArea(int16_t x, int16_t y, int16_t w, int16_t h){
    	scroll_x = x; 
    	scroll_y = y;
    	scroll_width = w; 
    	scroll_height = h;
    }
    
    void ILI9341_t3::setScrollBackgroundColor(uint16_t color){
    	scrollbgcolor=color;
    	fillRect(scroll_x,scroll_y,scroll_width,scroll_height,scrollbgcolor);
    }
    
    void ILI9341_t3::enableScroll(void){
    	scrollEnable = true;
    }
    
    void ILI9341_t3::disableScroll(void){
    	scrollEnable = false;
    }
    
    void ILI9341_t3::resetScrollBackgroundColor(uint16_t color){
    	scrollbgcolor=color;
    }

  11. #561
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,878
    @KurtE

    Have no problem if you want to update the joystick stuff like you did for the digitizer. Found just one problem using my old digitizer. It does hang after a when I move the pen away from the tablet or when I move my finger off the tablet, when I put it back down it works fine. Looks like for me with the dual output I have to just use the hid output.

  12. #562
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,872
    Hi @mjs513 - yes - I was thinking one of us can and should update the Joystick data to match.

    AND I also think having a scroll output mode for them would be fun to have as well. For example with the Tablet stuff, maybe it shows most all of the data like I have, but in scroll mode, we can maybe only display some of the primary data... We could obviously hook up the Touch screen and use touching the screen to change modes...

    Not sure yet what a good name for this app would be. Currently on my machine it is called Mouse_Joystick_viewer
    Which is not fully complete name: Could be some name simple like device_info_viewer or ???

    Obviously could also hook in Keyboard stuff if wanted... But not sure how best to handle if mouse AND keyboard connected...

  13. #563
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,878
    Quote Originally Posted by KurtE View Post
    Hi @mjs513 - yes - I was thinking one of us can and should update the Joystick data to match.

    AND I also think having a scroll output mode for them would be fun to have as well. For example with the Tablet stuff, maybe it shows most all of the data like I have, but in scroll mode, we can maybe only display some of the primary data... We could obviously hook up the Touch screen and use touching the screen to change modes...

    Not sure yet what a good name for this app would be. Currently on my machine it is called Mouse_Joystick_viewer
    Which is not fully complete name: Could be some name simple like device_info_viewer or ???

    Obviously could also hook in Keyboard stuff if wanted... But not sure how best to handle if mouse AND keyboard connected...
    I can take care of the joystick format tomorrow if you would like - not a problem. I was actually thinking about using the scroll area for the keyboard display. Only problem with the current layout is if you have a keyboard and mouse attached would be hard to display both set of data along with the joystick.

    Only problem with touchscreen is that it doesn't work with T$, I think.

    About USBHost_viewer? Covers everything.

    Funny about the scrolling that I got working in post #557 is that if you use Yellow for the background - no bleed through. If you use green or blue you get the bleed through with the black background. I can't figure the problem out, but will keep looking

    EDIT: Oh I got my breakout PCB today and was fitting parts. If you remember that SMD pin set for the underside, you won't be able to use. The pins are on 0.1inch spacing between rows. Have to wait for the board to see if you can move them closer and still maintain contact.

  14. #564
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,872
    @mjs513 - Pushed up the WIP USBHost_viewer app ...

    I thought the touch was working... But maybe not. Will take a look. I thought I tried it out on touch paint earlier. May be fun finding another pin to use... Earlier I am pretty sure I did it with the T$ plugged directly into breadboard.

    Unless you beat me to it, I will probably do a quick update of joystick data... May be interesting to be able to display some of the additional Axis for the different joysticks. Probably pick and choose which ones...

    Will be fun to see scroll info... We can probably easily make it such that the mouse data takes up less room. Could potentially do it if both devices detected...

    I still have not setup a new breakout board yet. Still trying to decide what I want on it... Things like:
    Should it be setup with pins for PJRC ILI9341 display? and/or simply setup Arduino pins and can use several different displays if desired or... I was going to ask about how to hook up USB, but I see you already asked with schematic and Paul gave some more pointers on it...

  15. #565
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,878
    @KurtE

    Ok confused here I have a ILI9341 display that have the following pins for touch:
    T_IRQ
    T_DO
    T_DIN
    T_CS
    T_CLK

    So what pins would I normally hook these up to?

  16. #566
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,872
    Quick update: My touchpaint_xpt2046 part of ili9341_t3n library is working on T4... Had to edit it to use CS=10, DC=9 was the other way around to get better speed...

    What I remember not working was the ILI9488? display that @defragster has as the display is holding the MOSI line such that other devices don't work on same SPI... But my memory may be off...

  17. #567
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,660
    I'll look to read understand the breakout silkscreen labels and get my ILI9341 connected instead of breadboard. Then I can use it for all of Touch/Pacman/USBHost etc. Though that is 14 pin a pain - looking to jumper to the PJRC OSH PurpleBoard so the shared SPI/VCC pins are auto connected and I have a display socket to swap.

    In my T$ efforts the Touch worked - but there was some oddity before I got sidetracked.

    Indeed I found my ili9344 only to work when TFT_MISO was not connected (cut the trace on PJRC OSH). And using PJRC.com's test for TriState with 10K resistors - the display did not tristate that pin - it did on both MOSI's and the Touch_MISO.
    Though IIRC the T$ version of that lib failed - though that may have been my failure to connect properly - but that may have been long ago on another breadboard wiring where I could swap the 9341

  18. #568
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,878
    @KurtE and @defragster

    Ok have the following hookup:
    T_IRQ --- NC
    T_DO ---- MOSI
    T_DIN---- MISO
    T_CS ----- 18
    T_CLK ---- 13

    Example for the xpt does seem to want to work for me. Will get the TFT piece but not the TS piece - may have to try it on the T3.6 tomorrow.

  19. #569
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,872
    Hi Mike pretty close to what I have...
    In case anyone else is trying to figure it out, I usually end up refereeing to the wiring table on the product page: https://www.pjrc.com/store/display_ili9341_touch.html

    And from my touchpaint example:
    Code:
    // On Teensy 4 beta with Paul's breakout out: 
    // Using pins (MOSI, MISO, SCK which are labeled on Audio board breakout location 
    // which are not in the Normal processor positions
    // Also DC=10(CS), CS=9(MEMCS) and RST 23(MCLK) TOUCH_CS=21(BCLK)
    #define TFT_RST 23
    #define TFT_DC 9
    #define TFT_CS 10
    #define TFT_SCK 13
    #define TFT_MISO 12
    #define TFT_MOSI 11
    #define TOUCH_CS 21

  20. #570
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,878
    @KurtE and @defragster
    Ok - changed my Touch_cs pin to 21 and it worked. Have a feeling I know what is going on. Have to check tomorrow.

    EDIT: Seem to be having a major problem with Touch. Responsiveness is almost non existent, either that or I have a bad connection. Just don't know. Redid the wiring about 10 times.
    Last edited by mjs513; 04-05-2019 at 02:08 AM.

  21. #571
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,660
    Arggh - USB keyboard flakey - lost LED backlight - had to reboot to get it to work at all …
    Trying to test budhaBrot as it was before moving T$ to breakout wired to test … neither T_3.6_C64 or T$ working now … what did I do to break them both … C64 is hardwired and was running old code … T$ still wired on breadboard … a new 9341 lib the other day I was testing ???

    Took a break to fix a few things in the outside world … didn't spill anything on keyboard … so much for relaxing with Teensy …

  22. #572
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,660
    Okay - Logitech K360 working on computer - new spacing Narrow ...

    Got ZIPs:: 5May_ILI9341_t3n-master.zip 5May_SPIN-master.zip 5May_USBHost_t36-WIP2-Bluetooth.zip

    Found this to work T$ : Kurts_ILI9341_t3n_FB_and_clip_tests.ino w/NOT_Flexi and RST==23

    Enough for now - these keys are all over

  23. #573
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,878
    @defragster/@KurtE

    Having major problems with touch - just can't seem to make it work right. I tried it on the T$ and on a T3.6 with no luck. I even used breadboard wires on the T3.6 to make sure. Ran the xpt test sketch as well just to see the values. Graphics work great but touch no luck.

  24. #574
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,872
    Good morning @mjs513 and @defragster - Not sure what is going on with the hardware... I don't use the touch screen much so not sure how well it works, but it has each time I tried...

    I know in my touch test program worked enough to finger paint a little... I don't think I ever updated the coordinate mapping to to be as complete as @defragster's version...

    Maybe bad hardware? Is the T-IRQ pin connected to anything? I don't think it matters...

    However if you are using the touchTest program it is configured to use an IRQ pin, I believe the default is pin 2, I verified that it maps the 2 to interrupt number...

    I have not tested that yet with T4...

  25. #575
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,878
    @mjs513 and @defragster
    Morning all. Been trying to get it to work all morning with no luck = including running the test with and without T_IRQ connected. And, Kurt, you are right doesn't matter if its connected or not still didn't work. I ordered another display so lets see what happens. Wont be here for a day or 2 so have to stick with graphics only unless there is something not right with the xpt library? Which I doubt.

    Kurt - what display are you using that works?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •