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

Added RP2040 Support #21

Merged
merged 9 commits into from
Oct 17, 2022
Merged

Added RP2040 Support #21

merged 9 commits into from
Oct 17, 2022

Conversation

Intubun
Copy link
Contributor

@Intubun Intubun commented Oct 14, 2022

And again added RP2040 Support for this Lib

@RobTillaart RobTillaart self-assigned this Oct 14, 2022
@RobTillaart RobTillaart added the enhancement New feature or request label Oct 14, 2022
@RobTillaart
Copy link
Owner

You did a lot of work! Thanks!

MCP4725.h Show resolved Hide resolved
@RobTillaart
Copy link
Owner

build failed on

/home/runner/Arduino/libraries/MCP4725/examples/MCP4725_wave_generator_RP2040/MCP4725_wave_generator_RP2040.ino:49:7: error: 'class MCP4725' has no member named 'selectWire1'; did you mean '_useWire1'?
   MCP.selectWire1();
       ^~~~~~~~~~~
       _useWire1

If you refactor the begin() the example needs to be rewritten (partially) too.

README.md Outdated Show resolved Hide resolved
@RobTillaart
Copy link
Owner

@Intubun

A good night sleep later I had some thoughts about the RP2040 support. As I do not have a RP2040 I cannot test this myself.

Is it possible to add the Wire or Wire1 instance in the constructor ?
That is already supported in the library, and if it works the PR is overkill.

MCP4725 mcp(addr, &Wire);

Can you give it a try?

The library does not track which Wire is used but is that a problem?

@Intubun
Copy link
Contributor Author

Intubun commented Oct 17, 2022

Yeah, it actually works! But some changes are still required for the output config of the RP2040, since it has some variables for setting the output pins...

@Intubun
Copy link
Contributor Author

Intubun commented Oct 17, 2022

And a useage example cant hurt ;-)

@RobTillaart RobTillaart merged commit 6b8b8db into RobTillaart:master Oct 17, 2022
@smithjacobj
Copy link

I'd like to make mention that this requires Arduino-Pico and not the official Arduino Mbed board library (which doesn't have Wire::setSDA/SCL)

https://arduino-pico.readthedocs.io/en/latest/install.html#installing-via-arduino-boards-manager

@RobTillaart
Copy link
Owner

Thanks for this info. Will read the link later today if time permits.
Probably true for all I2C libraries?

@smithjacobj
Copy link

Not necessarily? I'm not an expert, but I assume that this is just for Arduino IDE Wire-compatible interfaces. I'm sure you can use other libraries to access it.

Part of this is my inexperience with using Arduino IDE with RP2040 (I've only used it with Uno before) but it might be nice to know "hey, you can't just select the default builtin RP2040, you need Arduino-Pico" in the README section.

@RobTillaart
Copy link
Owner

RobTillaart commented Dec 31, 2022

Thanks, I better reopen this issue as reminder to add the note in the readme.

Mm PRs cannot be reopened.

Created issue #23

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

Successfully merging this pull request may close these issues.

None yet

3 participants