From f3ae93e8bf196979640d58843c1e31d6555841aa Mon Sep 17 00:00:00 2001 From: William Moore Date: Fri, 27 Oct 2023 17:54:05 -0500 Subject: [PATCH] Update to include dragondice nameplate code --- src/dragondice_nameplate.ino | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/dragondice_nameplate.ino diff --git a/src/dragondice_nameplate.ino b/src/dragondice_nameplate.ino new file mode 100644 index 0000000..80d1761 --- /dev/null +++ b/src/dragondice_nameplate.ino @@ -0,0 +1,49 @@ +/* +* dragondice_nameplate.ino - Displays an invite to learn Dragon Dice +* Copyright (C) 2023 William Moore +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +#include +LiquidCrystal lcd(8, 9, 4, 5, 6, 7); + +// define some values used by the panel and buttons +int lcd_key = 0; +int adc_key_in = 0; +#define btnRIGHT 0 +#define btnUP 1 +#define btnDOWN 2 +#define btnLEFT 3 +#define btnSELECT 4 +#define btnNONE 5 +#define btnRESET 6 + +const char * askToPlay = "DRAGON DICE: Ask me how to play!"; +void setup() { + Serial.begin(115200); + lcd.begin(16,2); + lcd.clear(); //Clear the display - this moves the cursor to home position as well + lcd.setCursor(0, 0); + lcd.print(askToPlay); +} + +void loop() { + const int maxPosition = strlen(askToPlay); + int position = 0; + for (position = 0; position < maxPosition; position++) { + lcd.scrollDisplayLeft(); + delay(500); + } +} \ No newline at end of file