The pull-up resistors must be between SDA and 3.3v and the other between SCL and 3.3v,
NOT VIN.
Now, depending on the LCD, it may work with 3.3v. I had some old LCDs that only worked with 5v, but I had newer ones that worked with either 3.3v or 5v. Also for 3.3v systems, the pull-up resistor would typically be 2.2K or 2.4K. 4.7K is the standard pull-up resistor for 5v systems. You can use it with Teensy, but it may prevent you from using the higher i2c bus speeds (which is not an issue in this case).
I would try using the LCD with a 3.3v setup:
- Teensy 3.3v to LCD VCC;
- Teensy normal ground (next to pin 0, not the analog ground between 3.3v and VIN) to LCD GND;
- Teensy pin 18/A4 to LCD SDA;
- Teensy pin 19/A5 to LCD SCL;
- 2.2K pull-up resistor between Teensy pin 18/A4 and Teensy 3.3v;
- 2.2K pull-up resistor between Teensy pin 19/A5 and Teensy 3.3v.
The 16x2 and 20x4 LCDs tended to have a back light to show the text. If the backlight doesn't show up, it may be the display needs 5v.
Then go to the Teensy IDE, and goto
Examples ->
wire ->
Scanner. Start the serial monitor, and then load this sketch. If the sketch hangs, then it is a sign that the pull-up resistors aren't right. If it finds a device, that is probably your LCD. If the scanner doesn't find any devices, then the setup isn't correct. If it prints a number in hex (starting with 0x), then that is the device id. If the number isn't 0x27, then you need to change your sketch to use that number. While 0x27 is the default, on some LCDs, you can change the default, and perhaps the default on your LCD is not 0x27.
If the i2c scanner doesn't show anything, then you need to think about using a level shifter.
In the future, when you add code to display there is a '#' button. Click that, and enter the text between the CODE and /CODE sections (CODE and /CODE will be inside square brackets).
Note, if you have a 16x2 display, you should change the 20, 4 to 16, 2.