Skip to content
NoisyVolt
NoisyVolt

music electronics make code

  • Build
  • Code
  • Play
  • Watch
  • Listen
  • Sound
NoisyVolt

music electronics make code

Display Test

andy, May 7, 2026May 8, 2026

Basic code to test display connection on Teensy

The display is a very cheap and common 4 line 20 character LCD

Note this uses the same 2 serial conenctions SDA/SCL as the Audio Shield but this is not a problem as long as they are on different adresses, as this is a serial bus arrangement

// 20x4 LCD Test — Teensy 4.0
// Assumes I²C backpack (PCF8574) soldered onto LCD
// Wiring: VIN->VCC, GND->GND, Pin18->SDA, Pin19->SCL
// Library: LiquidCrystal_I2C — install via Library Manager

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Most PCF8574 backpacks are 0x27, some are 0x3F
// Run I2C scanner sketch if unsure (see below)
LiquidCrystal_I2C lcd(0x27, 20, 4);

void setup() {
  Serial.begin(115200);

  Wire.begin();
  lcd.init();
  lcd.backlight();

  lcd.setCursor(0, 0);  lcd.print("Hello, Teensy 4.0!");
  lcd.setCursor(0, 1);  lcd.print("LCD 2004 Test");
  lcd.setCursor(0, 2);  lcd.print("I2C addr: 0x27");
  lcd.setCursor(0, 3);  lcd.print("Row 4 ready!");
}

void loop() {
  // Scroll a counter on row 3
  static unsigned long lastUpdate = 0;
  static int count = 0;

  if (millis() - lastUpdate > 500) {
    lcd.setCursor(0, 3);
    lcd.print("Uptime: ");
    lcd.print(millis() / 1000);
    lcd.print("s   ");   // trailing spaces clear old digits
    lastUpdate = millis();
  }
}
Build Code teensy

Post navigation

Previous post
Next post

Recent Posts

  • MIDI Loop Player
  • Sample Player on rPi
  • Display Test
  • Encoder Test
  • Audio Test

Archives

  • May 2026
  • April 2026
  • March 2026
Listen Watch Read Reference
©2026 NoisyVolt | WordPress Theme by SuperbThemes

Powered by
►
Necessary cookies enable essential site features like secure log-ins and consent preference adjustments. They do not store personal data.
None
►
Functional cookies support features like content sharing on social media, collecting feedback, and enabling third-party tools.
None
►
Analytical cookies track visitor interactions, providing insights on metrics like visitor count, bounce rate, and traffic sources.
None
►
Advertisement cookies deliver personalized ads based on your previous visits and analyze the effectiveness of ad campaigns.
None
►
Unclassified cookies are cookies that we are in the process of classifying, together with the providers of individual cookies.
None
Powered by