Hello!
In order to be helped, it might be wise to clearly say what's wrong. What do you want exactly?
I have tried to look at the code, but I would be in trouble if asked what it does.
Beside this, in any of your while loops, there are 2 occurrences of the measure function.
Usually you don't do that. You measure once per loop, you check other variables, buttons, etc,
and you update the display once per loop. You recalculate alpha (whatever it is) all the time,
etc...
Last but not least, you shouldn't use floats in an embedded system, except if there is really
no way to do otherwise.
Another thing: your LCD_DATAx are defined but never used in the whole file. Might be a reason
why it doesn't work. LCD_RW_PIN either.
I was saying "last but not least" but the more I look at the code, the more errors.
Your lcd.c includes lcd.c. Are you sure you want to do that?
Dora.