0

We're trying to make a project using atmega 16 and C language. The problem is that whenever we want to move a cursor, it goes to random places instead of moving one character right/left. Our first idea was just LCD_command(0x10); for going left. It didn't work although we are sure it should (turning off the cursor works in the same function). We also tried:

uint8_t position = 0;
[...]
void whichButton(){
whatsPressed = keybord();
switch (whatsPressed):
case 1:
{
position = position + 1; 
GoToXY (position, 0);
}
case 2:
{
position = position - 1;
GoToXY (position, 0); //for going left
}
}

Has anybody got any idea how to move it?

lawstud
  • 185
  • 14
  • How is `GoToXY()` currently implemented? – Ctx Jan 25 '16 at 19:21
  • Here you go. http://extremeelectronics.co.in/avr-tutorials/using-lcd-module-with-avrs/ – GroovyDotCom Jan 25 '16 at 20:50
  • I'm not familiar with the `atmega`, however, the usual method of getting special keys, like the arrow buttons, is to change to `raw` input rather than `cooked` input and comparing to the keyboard `scancodes`. – user3629249 Jan 28 '16 at 23:47

0 Answers0