Programming: Create a Chasing 'x' on the LCD to Determine the x and y LCD cursor Locations
Share
A moving 'x' is displayed along all possible LCD cursor locations and the actual location of the 'x' is displayed on the bottom right of the LCD to inform what are the possible locations on the current LCD. Many LCDs have different row ans column specifications. This program allow the user to determine the constraints of their LCD so the LCD can be used within these cursor location constraints. A for loop is used to cycle the 'x' in all of the cursor locations. An x is placed on the current location, a delay is used to give the user time to see the x and the location number. The cursor goes back to that location and displays a space to remove the 'x' so the next 'x' can be displayed and it appears to be moving.
for (int x = 0; x<128; x++) { Send_A_Command(0x80 + x); Send_A_String("x"); itoa(x, positionString, 10); Send_A_Command(0x80 + 97); Send_A_String(positionString); _delay_ms(50); end_A_Command(0x80 + x); Send_A_String(" "); }