Welcome! Log In Create A New Profile

Advanced

Adding Adafruit Neopixel library to Marlin

Posted by callumburns 
Adding Adafruit Neopixel library to Marlin
October 20, 2013 05:25PM
The while firmware stuff confuses the heck out of me and not sure how to go about doing this. I am looking to add this to Marlin: [learn.adafruit.com] to control these: [www.phenoptix.com] So they become status indicators (Green for good, Red for warning, going from blue to red as everything warms up, ) and while printing make some nice coloured patterns. I hope to then add something like this as a time indicator to show how long left of the print: [www.phenoptix.com] but thats for later on! RAMPS will be the hardware.
Re: Adding Adafruit Neopixel library to Marlin
October 28, 2013 08:46AM
Neopixel needs very precise timing, so does the reprap firmware for moves or you get blobs.

In my view the two are not compatible on a atmeg type processor, just not enough cpu power. (Haven’t actually tried this, but wouldn’t want to break reprap timing just for some LED's, just not worth it, im also using 60 leds, not just 8)

However... I have been working on a little project to solve this. Basically a led controller with a serial interface. Runs Neopixel library and takes commands over a serial interface.

I'm hoping to release details in a few days. (will be fully open source)

Currently have implemented a basic protocol and have the controller working. Now looking at adding control to marlin firmware.

Some eg of the simple serial protocol so far
:1 00-59 255 000 000 ; set leds 00 threw 59 to red full on.
:2 00 ; get led RGB values for led 00
:3 00-29 255 000 000 000 255 000; flash leds 00 threw 29 full red then to full green
:3 30-59 000 255 000 255 000 000; flash leds 30 threw 59 full green to full red (opposite timing to the above example, so half the led will be red and half green then they switch)

Edited 1 time(s). Last edit at 10/28/2013 09:34AM by Dust.
Re: Adding Adafruit Neopixel library to Marlin
October 28, 2013 12:47PM
Sounds good! Looking forward too it. It would be something I would be looking at doing is to increase the number of LEDs as and when. I was thinking seeing as I have a small number of LEDs maybe an ATTiny thats then controlled over I2C from the main board?

Edited 1 time(s). Last edit at 10/28/2013 12:48PM by callumburns.
Re: Adding Adafruit Neopixel library to Marlin
October 29, 2013 07:07AM
I've gone just with serial for now. (there are 2 that you can use on a standard ramps, 1 less if you have a LCD, but if you have max end stops... none are available)

Only tested this on a Sanguino 644p so far (Its what I had laying about) should work on any Arduino that the neopixel library supports

[github.com]

Next is to hack Marlin to talk to it....
Re: Adding Adafruit Neopixel library to Marlin
October 29, 2013 07:13AM
Nice work! Very nice work. Very helpful. grinning smiley thanks for shairing. I will have a play and see what I can do too.
Re: Adding Adafruit Neopixel library to Marlin
October 29, 2013 07:57AM
Oh, some ramps serial info you may need (not checked as 100% accurate yet, was quickly done at lunch time at work)
There are 4 ports on a atmeg 2560.

2 RXD0 PE0 ( RXD0/PCINT8 ) Digital pin 0 (RX0) serial over usb
3 TXD0 PE1 ( TXD0 ) Digital pin 1 (TX0) serial over usb
45 RXD1 PD2 ( RXDI/INT2 ) Digital pin 19 (RX1) Z-MAX
46 TXD1 PD3 ( TXD1/INT3 ) Digital pin 18 (TX1) Z-MIN
12 RXD2 PH0 ( RXD2 ) Digital pin 17 (RX2) on aux4
13 TXD2 PH1 ( TXD2 ) Digital pin 16 (TX2) on aux4
63 RXD3 PJ0 ( RXD3/PCINT9 ) Digital pin 15 (RX3) Y-MAX
64 TXD3 PJ1 ( TXD3/PCINT10 ) Digital pin 14 (TX3) Y-MIN

Serial2 on aux4 is easy-est, but that is often taken with a LCD
Second option is either Serial1 or Serial2, bloth clash with endstops in default configuration.
I'm planning to remove Z-MAX and Y-MAX pin definitions and move Z-MIN onto the Y-MAX pin, this frees up Serial1 for use.
If your using Max endstops... and have a LCD... you can probably move the endstops to other unused IO pins, haven’t looked at that yet.
Re: Adding Adafruit Neopixel library to Marlin
November 01, 2013 08:58PM
Ah feck! By the time you add the software serial and such to the code its too big to fit onto an ATtiny85. sad smiley Just have to use the sledge hammer of a ATmega 328! Unless there is something else that may work? Come to about 13000 bites.
Sorry, only registered users may post in this forum.

Click here to login