Skip to content

Commit

Permalink
Use software SPI for the display for the Teensy 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Compizfox committed Dec 21, 2023
1 parent 722c3ba commit 0be986e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ namespace config {

/// ST7920 LCD pins
const uint8_t PIN_LCD_CS = 10;
const uint8_t PIN_LCD_MOSI = 11;
const uint8_t PIN_LCD_SCLK = 13;

/// @name Thermistor pins
///@{
Expand Down
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ CharDisplayUI ui(&liquidCrystal, &buttonReader, &humidistat, trs);

SetpointProfileRunner spr(&humidistat);

#ifdef ARDUINO_TEENSYLC
U8G2_ST7920_128X64_F_HW_SPI u8g2(U8G2_R0, config::PIN_LCD_CS);
#endif
#ifdef ARDUINO_TEENSY40
U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, config::PIN_LCD_SCLK, config::PIN_LCD_MOSI, config::PIN_LCD_CS);
#endif
GraphicalDisplayUI<cHumidistat> ui(&u8g2, &buttonReader, &humidistat, trs, &eepromConfig, &spr);
#endif

Expand Down

0 comments on commit 0be986e

Please sign in to comment.