I am also trying to get the comparator to work on Teensy 4. Will it be possible for you to post the piece of code after you made the correction?
Thank you.