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

Independent Neopixel strips option #19115

Merged
merged 44 commits into from
Aug 27, 2020
Merged

Independent Neopixel strips option #19115

merged 44 commits into from
Aug 27, 2020

Conversation

Bacon-Fixation
Copy link
Contributor

@Bacon-Fixation Bacon-Fixation commented Aug 22, 2020

Requirements

Description

  • Add (M150 Sn) an extension of the M150 command to use it as a blend color that is different from the first NeoPixel and Caselight.
  • Add LCD Menu options for control of only the the separated neopixel2 pin

Benefits

  • More control options on the NeoPixel pins

  • Example: Say you're watching from a web cam you have the PrinterEvents on NeoPixel_pin after heat up they turn white and i want them to stay white through the print as normal but use M150 S1 to change the color of all of the LEDs on NeoPixel2_Seperate with varying intensities that are not set by the NeoPixel.
    Cura adds labels to the Gcode like SHELL, INFILL,..... and doing a Search replace with M150 S1 and a color value
    you can have this blending multi colored visual that let you kinda know at a glance at what phase of the layer the printer is at.

Related Issues

  • None that I know of

sorry im not a programer but i did my best to get 2 seperated controls for extra  visual indiaction from the LEDS by keeping the Printer Events on the main channel .
Originally labeled as DUET_SMART_EFFECTOR
but this is incorrect as MarlinCore looks for SMART_EFFECTOR and not DUET_SMART_EFFECTOR
@Bacon-Fixation
Copy link
Contributor Author

Bacon-Fixation commented Aug 23, 2020

Thank you for the help! I definitely need it <3

would like to still have a M151 command (or something different) if possible because wanted to use it as a blend color that is different from the first NeoPixel

for example watching from a web cam you have the PrinterEvents on NeoPixel_pin after heat up they turn white and i want them to stay white through the print as normal but use M151 to change the color of all of the LEDs on NeoPixel2_Seperate with varying intensities that are not set by the NeoPixel.

Cura adds labels to the Gcode like SHELL, INFILL,..... and doing a Search replace with M151 and a color value
you can have this blending multi colored visual that let you kinda know at a glance at what phase of the layer the printer is at.

would love to hear opinions

@thinkyhead
Copy link
Member

thinkyhead commented Aug 24, 2020

M150 Sn is a reasonable substitute for M151 and allows for any number of additional strips.

@thinkyhead
Copy link
Member

My aim in further cleanup will be to get rid of the duplicated Marlin_NeoPixel2 class and simply make Marlin_NeoPixel non-static or otherwise extend it so that it can address more than one Neopixel strip. The use of static classes in Marlin is to make the code smaller and faster. (Non-static methods have a hidden this argument.) If we make Marlin_Neopixel into a normal non-static class then we can have multiple unique instances which are managed by the LEDLights class. If we keep Marlin_Neopixel static but add the ability for it to represent multiple LED strips, then the class becomes slightly more complicated. The best-of-all solutions is to keep Marlin_Neopixel static when there's only one LED strip and non-static when there's more than one. That will keep the code as lean as it can be for the most common case.

@thinkyhead
Copy link
Member

Yes, this PR is going to be requiring a lot of tearing down and rebuilding. There will be more changes applied over the coming days, and things are bound to get broken in the process, until they get fixed. Thanks for keeping me posted about the current state.

@SparkyDan555
Copy link

There was a recently merged PR that (if im understanding your query correctly) will do what you are trying to achieve. See #18992 . It allows NEOPIXEL2_PIN to work independently of NEOPIXEL1_PIN by giving the second strip LED indexes of their own. Simply set NEOPIXEL2_INSERIES to true and use M150. Please let me know if this is not what you are trying to achieve.

@Bacon-Fixation
Copy link
Contributor Author

Bacon-Fixation commented Aug 25, 2020

when i tested #18992 the printer event overrides pin2 when enabled and i cant set just some of the pixels of second pin it was all or nothing,
but with M150 Sn we can have fully independent control of the pixels and the color that is not influenced by any other LED commands

Examples of wants:

  • M150 S1 R127 U127 B127 second pin White
  • M150 S1 I2 R for the Second Pixel of the second pin is red

trying out stuffs
@SparkyDan555
Copy link

Using the changes implemented in #18992, this is possible. Say for example you have 10 pixels on NEOPIXEL_PIN and 5 pixels on NEOPIXEL2_PIN and you wanted to set the 2nd pixel on NEOPIXEL_PIN to red. You would do this with M150 I1 R. To set the 2nd pixel on NEOPIXEL2_PIN to red you would send M150 I11 R. The only improvement I can see from your suggestions is the ability to set the entire NEOPIXEL2_PIN strip with one single command independently of the NEOPIXEL_PIN strip rather than issuing a separate M150 for every pixel on the second strip. Is this the intention?

@Bacon-Fixation
Copy link
Contributor Author

Bacon-Fixation commented Aug 25, 2020

TY for your reply <3
when I used #18992 there was no stopping printer events from influencing NEOPIXEL2_PIN, it's still tied to NEOPIXEL_PIN indirectly.
I want complete isolation from all other NEOPIXEL_PIN influences that is also separate from case lights

there isn't any LCD menu option to control ONLY NEOPIXEL2_PIN either

I want to apologize if I didn't provide enough info :D its a learning experience for me

@Bacon-Fixation Bacon-Fixation changed the title Control of Neopixel2_pin with an extended M150 command Control of Neopixel2_pin that is isolated from NeoPixel with an extended M150 command and menu control Aug 25, 2020
with NeoPixel2_separate enabled there isnt a conflict if they are different Neo type
i dont know why i thought this was needed

if neopixel is't enabled then there wont be a neopixel2
M150 S1 I1 R    ; Set SEPARATE index 1 to red
@thinkyhead thinkyhead changed the title Control of Neopixel2_pin that is isolated from NeoPixel with an extended M150 command and menu control Independent Neopixel strips option Aug 26, 2020
thinkyhead and others added 9 commits August 26, 2020 00:47
I dont know why but in Conditionals_LCD.h

MULTIPLE_NEOPIXEL_TYPES  isn't carried over from its definition in neopixel.h
moved the CONJOINED_NEOPIXEL from Conditionals_LCD.h to neopixel.h

because MULTIPLE_NEOPIXEL_TYPE wouldnt trip the trigger in conditionals
@thinkyhead thinkyhead merged commit 97ec6c1 into MarlinFirmware:bugfix-2.0.x Aug 27, 2020
susisstrolch pushed a commit to susisstrolch/Marlin that referenced this pull request Aug 28, 2020
…K8800-2.0.x

* tag '2.0.6.1' of https://github.com/MarlinFirmware/Marlin: (195 commits)
  Version 2.0.6.1
  [cron] Bump distribution date (2020-08-28)
  Add set_all_homed
  Mark axes not-homed with HOME_AFTER_DEACTIVATE (MarlinFirmware#18907)
  set_axis_not_trusted => set_axis_never_homed
  Independent Neopixel option (MarlinFirmware#19115)
  Fix Creality V4 probe pin
  Fix small typø
  Allocate sufficient MSG_MOVE_Z_DIST buffer
  One MARLIN_DEV_MODE warning per rebuild (MarlinFirmware#19163)
  FYSETC S6 2.0 (MarlinFirmware#19140)
  [cron] Bump distribution date (2020-08-27)
  Fix SINGLENOZZLE fan speed bug (MarlinFirmware#19152)
  Fix NEOPIXEL_STARTUP_TEST last delay (MarlinFirmware#19156)
  TFT (plus Hardware SPI) for LPC (MarlinFirmware#19139)
  Prusa => Průša
  Direct Stepping update (MarlinFirmware#19135)
  Fixes to FTDI Touch UI (MarlinFirmware#19134)
  Add Einsy Rambo Filament Runout Pin (MarlinFirmware#19136)
  Fix SD pins for SKR Pro and GTR (MarlinFirmware#19047)
  ...
albertogg pushed a commit to albertogg/Marlin that referenced this pull request Aug 31, 2020
thinkyhead pushed a commit to thinkyhead/Marlin that referenced this pull request Sep 2, 2020
vgadreau pushed a commit to vgadreau/Marlin that referenced this pull request Dec 9, 2020
kageurufu pushed a commit to CR30-Users/Marlin-CR30 that referenced this pull request Apr 30, 2021
thinkyhead added a commit to MarlinFirmware/MarlinDocumentation that referenced this pull request Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants