Update to include dragondice nameplate code

This commit is contained in:
William Moore 2023-10-27 17:54:05 -05:00
parent 9e9e3b5f85
commit f3ae93e8bf
1 changed files with 49 additions and 0 deletions

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include <LiquidCrystal.h>
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);
}
}