<p>As your color is based on the temp reading, as far as I know, there is no G-code to read a temperature and push that value to another command.
The way you can do it is:</p>

<ol>
<li>Static color change - use same method as you are setting to white</li>
<li>Intercept firmware temperature reading function and push that value to led module</li>
</ol>

CC BY-SA 4.0
2018-05-06T20:38:36.520Z
2018-06-06T09:27:36.450Z
2018-06-06T09:27:36.450Z
profesor79
<p>I wrote a command in Marlin firmware which changes Neopixel color based on extruder temperature.</p>

<p>In my start G-code for I set the color to white. How to execute my above command from the end G-code so that the the color changes per request?  </p>

<marlin><g-code><firmware>
How to execute firmware command from gcode
kosbou
# How to execute firmware command from gcode

(Asked by: username_0 on 2018-05-06)

I wrote a command in Marlin firmware which changes Neopixel color based on extruder temperature.

In my start G-code for I set the color to white. How to execute my above command from the end G-code so that the the color changes per request?

**Tags:** marlin, g-code, firmware


---

## 1 answers

### Answer by username_1 on 2018-05-06. Score: 1

As your color is based on the temp reading, as far as I know, there is no G-code to read a temperature and push that value to another command.
The way you can do it is:

1. Static color change - use same method as you are setting to white
2. Intercept firmware temperature reading function and push that value to led module


---

