Madhurakshi B S
Newbie level 6
Good Morning Sir/Madam,
I am using 16x2 LCD and 4x4 keypad in my project. I want use arrow keys in my project hence i want to the current position of the lcd cursor. Once the current position of lcd is know it is easy to function the arrow keys. In "keypad Arduino" library available there is a function called ' lcd.setCursor' and ' lcd.cursor ' in which the former sets the cursor position and later blinks the cursor but do not provide the current position of the cursor.
If there is any such function in Arduino lcd or Arduino keypad please let me know.
I have used the following function to know the current position of the cursor on lcd. please let me know whether the following code is correct or not.
with regards
Madhurakshi B S
I am using 16x2 LCD and 4x4 keypad in my project. I want use arrow keys in my project hence i want to the current position of the lcd cursor. Once the current position of lcd is know it is easy to function the arrow keys. In "keypad Arduino" library available there is a function called ' lcd.setCursor' and ' lcd.cursor ' in which the former sets the cursor position and later blinks the cursor but do not provide the current position of the cursor.
If there is any such function in Arduino lcd or Arduino keypad please let me know.
I have used the following function to know the current position of the cursor on lcd. please let me know whether the following code is correct or not.
Code:
const int numrow = 2;
const int numcol = 16;
int thisrow = 0; // count taken for row
int thiscol = 0; // count taken for col
bool k;
void cursorlcd();{
char key = keypad.getKey();
k = (isalpha (key) || isdigit(key));
if (k == TRUE);
{
for (int thisRow = 0; thisRow < numRows; thisRow++) {
// loop over the rows:
for (int thisCol = 0; thisCol < numCols; thisCol++) {
// set the cursor position:
return thisrow;
return thiscol;
}
}
}
}
with regards
Madhurakshi B S
Last edited by a moderator: