Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where can i find the processor defines, to add support for new boards? #69

Open
Chick92 opened this issue Jun 3, 2021 · 10 comments
Open

Comments

@Chick92
Copy link

Chick92 commented Jun 3, 2021

This library is hands down the best encoder library.

I'm trying to add support for the raspberry pi pico and for the robotis OpenCR, both of which i seem to use every day of late. Try as i might though, i can't find where the processor is defined, to add it in to your library. E.g for an arduino Mega it woud be -

#elif defined(AVR_ATmega1280) || defined(AVR_ATmega2560)

Cheers.

Ben

@PaulStoffregen
Copy link
Owner

@Chick92
Copy link
Author

Chick92 commented Jun 3, 2021

That's where they're programmatically identified in your library, but where is this definition actually made? E.g if i want to add support for another board, is it in boards.txt or something similar?

@PaulStoffregen
Copy link
Owner

I don't know exactly where names like AVR_ATmega2560 are defined. I've always imagined it's built into the compiler. It might be in avr-libc header files, or somewhere else in the toolchain. For all practical purposes, those are from the compiler.

@oerkel47
Copy link

oerkel47 commented Aug 2, 2021

@Chick92 Have you made progress with support for the Pi Pico? I think I got the encoder library adapted properly but the readings are a bit off with arduinoCore-mbed. I think there must be some inaccuracies with the interrupts.. But doesn't work with https://github.com/earlephilhower/arduino-pico at all.

Check it out if you like: https://github.com/oerkel47/Encoder/tree/oerkel47-pico-support

@Chick92
Copy link
Author

Chick92 commented Aug 2, 2021

@oerkel47 no I gave up with it. But, as for your problem, try declaring pinMode again after you attach the interrupt. There’s a bug in the mbed core, I’ve flagged it with them (on my phone so no link sadly) but that should solve your issue.

@oerkel47
Copy link

oerkel47 commented Aug 5, 2021

@Chick92 thanks for your reply. I already read through the discussion you are refering to. Unfortunately that's not the problem. It works in principle, but it skips steps or counts wrong direction etc. So something is inaccurate with the registering of the interrupts is my guess.

@ale-novo
Copy link

ale-novo commented Nov 7, 2022

Hi, any luck on this? i have this exact same problem with skipping steps or count in the incorrect direction.

@oerkel47
Copy link

oerkel47 commented Nov 10, 2022

@ale-novo I have not really kept up with the state of things regarding Pico. There are two arduino cores for Pico. The mbed stuff and the one from earlephilhower. Have you tried both?

@ale-novo
Copy link

ive tested earlephilhower using the BASIC ino example but serial wont report back not sure what is happening.

@oerkel47
Copy link

I have tried it too, still doesn't work. Polling works fine with both cores. At least for casual applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants