January 8, 2017
Description
I integrated a 12 pixel neopixel ring into my printer to act as a temp gauge when warming up and cooling down, then just a random color fading widget while at temp. I used FKOne's mount as a backing to attach it to my printer. It needed a little bit of a diffuser and I had some glow-in-the-dark filament handy so I made this snap fit cover for it.
The result is three 0.3mm layers of solid fill glow-in-the-dark filament and a ring that snaps over the frame. I might add a few more layers later or make it so it stands off of the frame a little further but I'm satisfied with it for now.
Let me know if you're interested in my wiring and code.
UPDATE 8/6/2017
Here are the changes I made to my Marlin code:
Add the Adafruit Neopixel library .h and .ccp files to the same folder Marlin is in.
Find the function "void manage_inactivity" and add the following to the last line of the function:
"dispTempGauge(); //Call's Dan's temp gauge"
Add the following function: (I added it below the Temp_Stat_LEDs fuction)
//
// Begin Dan's Custom Coloring!!
//
//
unsigned long previousMills = 0;
unsigned long currentMills = 0;
int guage_type = 2; //default to display off
int guage = 3;
void dispTempGuage(){
int8_t cur_extruder = 0;
currentMills = millis();
if (currentMills - previousMills > 200) { // Update every 0.2s
previousMills = currentMills;
if ((isHeatingHotend(cur_extruder)) && (degTargetHotend(cur_extruder)>100.0) && ((degTargetHotend(cur_extruder)-degHotend(cur_extruder))>2)){
guage_type = 1; //if heating up && target is set high && not there yet
}
else if(degHotend(cur_extruder)>150.0){ //if not heating and temp is above minimum then dance
guage_type = 2;
}
else if(degHotend(cur_extruder)>30.0){ //when done dancing then show cool down from prev temp setting?
guage_type = 3;//busy printing
}
else{ //if none of the above then the printer must be idle. turn all lights off.
guage_type = 0; //lights off
}
switch (guage_type){
case 0://off
for(int i=0;i<NUMPIXELS;i++){
pixels.setPixelColor(i,0,0,0);
}
break;
case 1: //Heating
pixels.setPixelColor(0,128,0,0); //Pixel 0 is Hot sample
pixels.setPixelColor(1,0,128,0); //Pixel 1 is Green status
pixels.setPixelColor(2,0,0,128); //Pixel 2 is Cold sample
guagecolor = pixels.Color(map(degHotend(active_extruder),20,degTargetHotend(cur_extruder)-2,0,128),0,map(degHotend(active_extruder),20,degTargetHotend(cur_extruder)-2,128,0));
guage = map(degHotend(active_extruder), 20, degTargetHotend(cur_extruder)*.99, 3, 11); //maxTemp*.90 is to scale the max pixel down slightly. Otherwise max is firm MAX.
for(int i=3;i<guage+1;i++){
pixels.setPixelColor(i,guagecolor);
}
for(int i= guage+1;i<NUMPIXELS;i++){
pixels.setPixelColor(i,0,0,0);
}
break;
case 2: //busy printing so show random fades
for(int i=0;i<NUMPIXELS;i++){
colorR[i] = constrain(colorR[i]-fade,0,255);
colorG[i] = constrain(colorG[i]-fade,0,255);
colorB[i] = constrain(colorB[i]-fade,0,255);
pixels.setPixelColor(i,colorR[i],colorG[i],colorB[i]);
}
index=random(NUMPIXELS);
colorR[index]=random(174);
colorG[index]=random(174);
colorB[index]=random(174);
pixels.setPixelColor(index,colorR[index],colorG[index],colorB[index]);
break;
case 3: //cooling
pixels.setPixelColor(0,64,0,0); //Pixel 0 is Hot sample
pixels.setPixelColor(1,0,64,0); //Pixel 1 is Green status
pixels.setPixelColor(2,0,0,64); //Pixel 2 is Cold sample
guagecolor = pixels.Color(map(degHotend(active_extruder),20,210,0,64),0,map(degHotend(active_extruder),20,210,64,0));
guage = map(degHotend(active_extruder), 20, 210*.98, 3, 11); //maxTemp*.98 is to scale the max pixel down slightly. Otherwise max is firm MAX.
for(int i=3;i<guage+1;i++){
pixels.setPixelColor(i,guagecolor);
}
for(int i= guage+1;i<NUMPIXELS;i++){
pixels.setPixelColor(i,0,0,0);
}
break;
}
pixels.show();
}
}
License:
Creative Commons - Attribution