Using buttons as a keyboard to write on an lcd

im trying to make it so buttons on a breadboard input as letters on an lcd, and ive got that figured out. but i want backspace (i know how to do that) , but i cant figure out enter fully. Ive got it where it can go down a line but when i get to the bottom of the lcd i want it to go back to the top but to go to the front of the line (for example if i type 3 letters on row 0, move to row 1 and want to go back to row 0, itll just take me to the start. i want to basically completely ignore the column value but cant figure out how.

#include <Adafruit_LiquidCrystal.h>
int buttonA= 6;
int buttonEnter= 12;
int seconds = 0;

Adafruit_LiquidCrystal lcd(0);

void setup()
{
  lcd.begin(16, 2);
  Serial.begin(9600);
    pinMode(buttonA,INPUT_PULLUP); //button
    pinMode(buttonEnter,INPUT_PULLUP); //button
 lcd.setCursor(0,0);
}

void loop()
{
  if(digitalRead(buttonA)==LOW){ 
     lcd.print("a"); 
    delay(100);
  }
    if(digitalRead(buttonEnter)==LOW){ 
      if (lcd.cursor==(0)){
      lcd.setCursor(0);
      }
    delay(100);
  }
}

What does that block do ?

my bad, where the 0s are i was just putting in random stuff i thought might work but eventually i settled on

    if(digitalRead(buttonEnter)==LOW){ 
      lcd.setCursor(0,+1);
      }

its not perfect but it works for the initial going down a row , i still need help figuring out how to navigate the rows regardless of column

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.