Sorry Camerart, that was was my mistake. I thought the 4620 was just the increased memory version of the 4520, but they are different PICs.
When I suggested that I only looked at the fact the 4620 has double the RAM and ROM compared to the 4520, but missed that it also had an inbuilt LCD driver. Sorry!
Re the arctan function I like Eric's suggestion of just using a lookup table. You can use Excel spreadsheet to make a lookup table, and cut/copy the values as text and put that in your code.
You only need the table to cover one octant if you want to derive angle from X and Y grid distances. I'd use a binary sized table (say 64 or 128 entries) to cover the 45 degree octant. That will make it easier to scale and makes the math quicker.
When I suggested that I only looked at the fact the 4620 has double the RAM and ROM compared to the 4520, but missed that it also had an inbuilt LCD driver. Sorry!
Re the arctan function I like Eric's suggestion of just using a lookup table. You can use Excel spreadsheet to make a lookup table, and cut/copy the values as text and put that in your code.
You only need the table to cover one octant if you want to derive angle from X and Y grid distances. I'd use a binary sized table (say 64 or 128 entries) to cover the 45 degree octant. That will make it easier to scale and makes the math quicker.