The code element is used when you want to paste in bits of code, like so:
void loop() { uint8_t red, blue; float temp = mlx.readObjectTempF(); if (temp < COLDTEMP) temp = COLDTEMP; if (temp > HOTTEMP) temp = HOTTEMP; // map temperature to red/blue color // hotter temp -> more red red = map(temp, COLDTEMP, HOTTEMP, 0, 255); // hotter temp -> less blue blue = map(temp, COLDTEMP, HOTTEMP, 255, 0); colorWipe(strip.Color(red, 0, blue), 0); delay(50); // can adjust this for faster/slower updates } // Fill the dots one after the other with a color void colorWipe(uint32_t c, uint8_t wait) { for(uint16_t i=0; i<strip.numPixels(); i++) { strip.setPixelColor(i, c); strip.show(); delay(wait); }
The most important thing here is to make sure to select the right type of code you are pasting. In this case, I pasted Arduino code:
By selecting what type of code you are pasting, it changes how the code is displayed to your readers to make it easier to read. Learn will attempt to detect the language if auto detect is selected.
Text editor powered by tinymce.