KurtE
Senior Member+
I wondered about the colors. I have a different sketch that was using those colors, but did not find them in the header files... ButCompiled code and got errors for COLOR16M. The compiler graciously made some suggestions to change to COLOR65K and now the compiler is happy.
when I clicked on it and asked to show me in sources it showed the same names... At the spot now in header file with 65K...
Guessing @wwatson changed the names, but was still in Arduino cache...
Note: I am still hacking on the touch code. I am going to experiment some with speeding it up. That is I currently read
in enough data from the device for both possible touch, even though I only use one... in this case, so will setup configuration
where I can choose to just read in one.
Also each time I do a read, I tell it to start at register 0... Not sure if I need to do this every time or if will go back to 0 on the next read.
...
Yes on T4.1 I am using Wire2. As the pins for Wire and Wire1 are used by the FlexIO object that is used for the actual display:I see in your code you have Wire and wire2. I am assuming it it using wire2 because it is a T41 so I changed to pin 8 "#define CTP_INT_PIN 8". I don't see how to set pins for SDA2 and SCL2 or how to git it an address if the touch screen has one. Can you point me in the correct direction
If you look at the Teensy card, you will see that Wire2 are on pins 25 and 24.
Wire is on 18 and 19 and Wire1 is on 17 and 16. These are the default pins for the
different Wire objects. Wire1 has a few alternative pins you can see on the back of the
card, but none of those are convenient (On SDCard Adapter and memory pin)
Currently in my code you can optionally pass in which Wire object to use on the begin method:
Code:
if (!ctp.begin(&TOUCH_WIRE)) {
Code:
#ifdef ARDUINO_TEENSY41
#define TOUCH_WIRE Wire2
#define CTP_INT_PIN 26
#else
#define TOUCH_WIRE Wire
#define CTP_INT_PIN 22 // 0xff if pin is not connected
#endif
Note: there is really nothing special about my library versus the others. It is mostly just reading data in using I2C.
The only thing mine does that some don't is if you specify an IO pin for the Interrupt, the touched() method will check to
see if it had received an interrupt. If not returns false...