Go Down

Topic: HELP: max number count (Read 2205 times) previous topic - next topic


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.



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.


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.




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

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131