Skip to content

Removed hardcoded pin #1

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

Merged
merged 2 commits into from
Apr 8, 2025
Merged

Conversation

jakebierman
Copy link

Can now use PinName or PinNameToIndex to select NeoPixel pin eg.

Adafruit_NeoPixel strip(NUMPIXELS, PinNameToIndex(PC_3), NEO_GRB + NEO_KHZ800);
or
Adafruit_NeoPixel strip(NUMPIXELS, PC_3, NEO_GRB + NEO_KHZ800);

I have only tested this on PH_15 and PC_3 for my project but believe it should work with any pin.

Can now use PinName or PinNameToIndex to select NeoPixel pin
Included both defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
So that it works fine on both cores on the H7
@Workshopshed
Copy link
Owner

Thanks Raz for the mention, totally missed Jakes PR

@razvanphp
Copy link

NP, can you also please pull origin master? It's 100 commits ahead, maybe we can get it to a state that could become a PR.

I have an idea to use mbed hardware timers instead of wait_ns which is blocking the MCU. Can we collaborate on your fork?

#include <pinDefinitions.h>
#endif
#endif

Copy link

@razvanphp razvanphp Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to cut it:

/Users/razvan/Library/Caches/arduino/sketches/5F7B38B7ACE97AB5A4ED558FDF30C7B6/libraries/Adafruit_NeoPixel/portenta.c.o: In function `portentaShow':
/Users/razvan/Documents/Arduino/libraries/Adafruit_NeoPixel/portenta.c:15: undefined reference to `digitalPinToPinName'
collect2: error: ld returned 1 exit status

Maybe related: arduino/ArduinoCore-mbed#244 (comment)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Raz, this definitely worked back when I used it, but I recall lots off issues with the pindefinition file and portenta, I ended up grabbing a copy from the arduino install directory and included it locally in my project, it's not a great solution but I was on limited time so did the the trick for me.
If you do this be aware it can only be included once, so may get issues if other libraries also try and import it, not sure when I'll get time dig up my code again but will see if I can find some time to get a full working example

That portenta was a nightmare and wouldn't recommend to anyone, I had no choice of hardware for the project and found so many issues in libraries and support, unless you pay of course

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is because portenta.c should be renamed to portenta.cpp, deep includes might need it.

@Workshopshed
Copy link
Owner

Happy to collaborate, noticed the fork was behind. May have time to fix merge conflicts next week

@razvanphp
Copy link

I pushed a PR for your fork that works, I tested it on the bench, but probably this is not needed anymore, found a way more elegant way to support the Portenta: adafruit#428

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

Successfully merging this pull request may close these issues.

3 participants