Go Down

Topic: HELP: max number count (Read 1 time) previous topic - next topic

VK5VCO

Hello,
I have been playing around with some quadrature encoders, I have it counting up and down nicely, BUT I have a problem when I reach 65535 next number is zero, surely it can count higher than that I need to be able to count up to about 144000.
My project is using the quadrature encoders to precisely work out what angle the antennas are pointing up to 0.01 of a degree.
Has anybody got any ideas that might help.

Cheers
Paul

jraskell

Use an unsigned long.

unsigned int is a 16bit type with a range of 0-65535.
unsigned long is a 32bit type with a range of 0-4,294,967,295.

VK5VCO

Cheers for that, I am new to the Arduinos still getting use to them, and they rock compared to others, lots of demo code.
I put another post in to explain it a little bit better.

Cheers

Paul

smeezekitty

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

Go Up