encoder and math NCD function

rjconway

New Member
As I was trolling through the manuals and found the NCD function and was wondering if I could use this function with a simple encoder for an LCD menu system. I didn't know if we have always had NCD or if its an x1 x2 added feature.
 

hippy

Ex-Staff (retired)
PICAXE Manual 2, page 23 - NCD is an added X1 and X2 feature.

I'm not sure if it will help in an LCD menu system; its detailed description is on page 24. It determines which highest bit is set in a variable, it is the equivalent inverse of the DCD command.

"w0 = DCD 3" set w0 to $0008, bit 3 set ( fourth bit )

"w1 = NCD $0008" sets w1 to 4, fourth bit is set ( bit 3 )
 

westaust55

Moderator
@tjconway,

you need to give more information about precisely what you are trying to achieve.

When 1 years ago now I wrote code to drive an LCD module out of a Siemens A55 mobile phone, I used the NCD and DCD commands for ease when using a 40X1. Those commands have been around for the 16 months that I have been using PICAXE.

http://www.picaxeforum.co.uk/showthread.php?t=10014&page=4
Have a look at the code over 3 posts starting around post 36/37.
If this is the sort of thing you are trying to do then start at post 1 and read the entire history as I worked up a number of routines for basic fonts, drawings lines and circles, displaying graphs, creating a compass display and . . . .


Other members here (Tarzan? from memory) have created menu routines for standard LCD modules as opposed to gLCD modules.
 
Top