I'm trying to create a sort of number picker. It'll show you 0 to 9 and using an X, which I will write over the number you can choose a number. As an example 01234567x9 or 0123x56789. I'm struggling however with printing this to an LCD. I'm using a tinkercad so all of my pin connections are predefined and pretty much correct. I'm using the standard tinkercad LCD and LiquidCrystal as a library.
But when I use lcd.print("Hello World) in void loop() it continuously prints Hello World, obviously because I put it in a loop. I've tried to put it in a function but I can't quite get it to work... Some help would be perfect.
This is the code I'm currently using, it returns "too many arguments to function 'void PrintText()'" as an error.
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
char lcdtxt[] = "0123456789 x";
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
}
void PrintText(){
lcd.print(lcdtxt);
lcd.clear();
}
void loop() {
PrintText(lcdtxt);
}