Pages: [1]   Go Down
Author Topic: HELP: max number count  (Read 1229 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

New Hampshire
Offline Offline
God Member
*****
Karma: 13
Posts: 779
There are 10 kinds of people, those who know binary, and those who don't.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Washington
Offline Offline
God Member
*****
Karma: 30
Posts: 780
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Duplicate thread.
Logged

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!

Pages: [1]   Go Up
Jump to: