From 8660721802c0f8ec9c85f7f415bb29d16b722645 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Thu, 23 Jul 2020 19:46:24 +0200 Subject: [PATCH] LCD --- trigorilla/platformio.ini | 1 + trigorilla/src/main.cpp | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/trigorilla/platformio.ini b/trigorilla/platformio.ini index f5b54ac..8a1334f 100644 --- a/trigorilla/platformio.ini +++ b/trigorilla/platformio.ini @@ -18,6 +18,7 @@ lib_deps = # TimerOne # AccelStepper # SpeedyStepper + LiquidCrystal [env] framework = arduino diff --git a/trigorilla/src/main.cpp b/trigorilla/src/main.cpp index 50d17db..0b936d8 100644 --- a/trigorilla/src/main.cpp +++ b/trigorilla/src/main.cpp @@ -6,6 +6,7 @@ #include #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) +#define REPRAP_DISCOUNT_SMART_CONTROLLER #include "pins/pins_TRIGORILLA_14.h" #elif defined(__AVR_ATmega328P__) #define LED_PIN LED_BUILTIN @@ -26,7 +27,24 @@ #define E1_ENABLE_PIN A4 #endif +#define LCD_PINS_RS 16 +#define LCD_PINS_ENABLE 17 +#define LCD_PINS_D4 23 +#define LCD_PINS_D5 25 +#define LCD_PINS_D6 27 +#define LCD_PINS_D7 29 + +#define BTN_EN1 31 +#define BTN_EN2 33 +#define BTN_ENC 35 + +#define BEEPER_PIN 37 +#define KILL_PIN 41 +#define SD_DETECT_PIN 49 + #include "stepper.h" +#include +#include const int NUM_STEPPER = 5; @@ -36,6 +54,8 @@ TimerStepper stepper[NUM_STEPPER]; LoopStepper stepper[NUM_STEPPER]; #endif +LiquidCrystal lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5, LCD_PINS_D6, LCD_PINS_D7); + unsigned long lastMillis = 0; unsigned long lastCommand = 0; const long interval = 1000; // interval at which to blink (milliseconds) @@ -58,6 +78,9 @@ void setup() pinMode(TRIGORILLA_HEATER_0_PIN, OUTPUT); digitalWrite(TRIGORILLA_HEATER_0_PIN, HIGH); + lcd.begin(20, 4); + lcd.print("ROBERTO"); + stepper[0].begin( X_DIR_PIN, X_STEP_PIN, X_ENABLE_PIN); stepper[1].begin( Y_DIR_PIN, Y_STEP_PIN, Y_ENABLE_PIN); stepper[2].begin( Z_DIR_PIN, Z_STEP_PIN, Z_ENABLE_PIN);