Hi everyone,
Obligatory “I’m new, please be gentle”
My Problem
- When I upload code from PlatformIO, the characters displayed on the lcd are wrong/corrupted garbage. The output is always the same.*
- Identical code works fine when uploaded from the Arduino IDE
Below is info you may ask me for immediately, followed by ideas I’ve had
Hardware Information
- Windows 10, 64 bit, version 21H2
- VS Code version 1.63.2
- Using Teensy 2.0++
- Teensy Loader v1.55
Code
Identical code works properly when uploaded with Arduino IDE
#include <Arduino.h>
#include <Wire.h> // Necessary to avoid library dependencies issue in VS Code -that’s a different issue
#include <LiquidCrystal.h>const int RS = 18, EN = 19, D4 = 23, D5 = 24, D6 = 25, D7 = 26;
LiquidCrystal lcd(RS, EN, D4, D5, D6, D7);void setup() {
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(“anything”);
}void loop() {
}
platformio.ini
[env:teensy2pp]
platform = teensy
board = teensy2pp
framework = arduino
lib_deps =
fmalpartida/LiquidCrystal@^1.5.0
Ideas
- Complaining loudly has had no noticable effect.
- I couldn’t find anything on Google, so maybe I just can’t find the special combination of google-fu words to find what I need.
- I’ve attempted creating a new, clean project and removing any unnnecessary code.
- Serial monitor works properly, and I can blink LEDs without issue. This leads me to believe it’s not a COM port issue, though I have tried manually adjusting that -no difference.
- There are 2 LCD displays connected to identical pins on the Teensy. That is to say that one set of microcontroller outputs connects to 2 displays. Again, they work properly when uploaded through Arduino IDE, but they are both different when uploaded through VS Code. This leads me to believe I have something setup inproperly within VS Code / PlatformIO
edit: formatting