I'm new to the Arduino but have been working with PICBasic for a few years.
I'm liking the C stuff though.
My question- I'm working with the QuadratureEncoder Library Example and having good success. One thing I'm not sure about is how to clear(0) or reset the encoder count from inside my program. This is so that the next time it's called, the position will be correct regardless of where it was before.
Is it as simple as declaring the outside variable in my sketch or would that cause "havoc"? Is it a specific "C" thing I just haven't found yet? I have search the site and Google without much luck but maybe my terms haven't been correct.
I've included the piece of code in question:
long currentEncoderCount = rotaryEncoder.getEncoderCount();
rotaryEncoder = 0;
post the entire error message. There is a "copy error message" button (lower right of IDE window). Copy the error and paste into a new post in code tags. Paraphrasing the error message leaves out important information.
If you need to start a new session of counting then save the count at that point in a variable with a sensible names, say startCount. At any time in the future when you read the current count subtract startCount from the current count to determine how many events have occurred
I did see that in the cpp. When I tried to access or use it, I would get a declaration error.
Looks very interesting, I'll check out that gfvalvo.
Also, I know it's probably better to to manage the counts myself(or buy an absolute). I was just curious on how the Sketches work in conjunction with the includes. Didn't know how much was accessible or not. Again, probably has more to do with my ignorance in C than the Arduino aspect. I will study more.