> Its not a good idea to use 0.5*(etc etc).

Actually, it's not a good idea to use any numbers with Decimal places... Why? Because PICBasic ONLY works with INTEGERS.