
Originally Posted by
Steve Matson
I am in a situation where I am controlling a stepper motor with a Pic and I need to count off up to 1900 stepps. Also I need to take the counted number of stepps and compare to another number to see which is higher or lower and subtract the difference. I guess I need to learn how to do natural math with Pics. For example: 1373 - 812 or whatever. I heard there are 'co-processors' but I dont know much about them. Does anybody have any ideas.
Thanks in advance,
Steve Matson
Hi Steve,
8 bits to a byte, 16 bits or 2 bytes to a word. Byte holds 0 - 255, word holds 0 - 65535
Count binary, each time you add a bit to the left the value doubles which is to say 010 is twice the value of 001, so if 11111111 = 255 then 1 00000000 is 256 and 1 00000001 is 257 etc, if you are using windows, fire up the calculator, switch it to scientific mode and enter any number smaller than 65535 and then click the button marked " BIN " and you will see the binary representation which is how the number is positioned in the WORD.
JS
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks