[{"data":1,"prerenderedAt":1391},["ShallowReactive",2],{"Categories":3,"NavIndexCategoriesCountFooter":203,"content-\u002F2021\u002F05\u002F19\u002Fteensy-4-with-fastled\u002F":204},[4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,70,71,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202],{"category":5},"System Administration",{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},"Software Development",{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":27},{"category":27},{"category":67},"Drones & RC",{"category":69},"DIY Projects",{"category":67},{"category":72},"Photography",{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":67},{"category":67},{"category":72},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":5},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":67},{"category":67},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":72},{"category":67},{"category":138},"3D Printing - Laser Cutting - CNC",{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":5},{"category":138},{"category":27},{"category":27},{"category":138},{"category":138},{"category":72},{"category":158},"Photography,3D Printing - Laser Cutting - CNC",{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":67},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":181},"Home Assistant",{"category":181},{"category":72},{"category":27},{"category":27},{"category":72},{"category":138},{"category":5},{"category":72},{"category":72},{"category":138},{"category":27},{"category":181},{"category":181},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},191,{"id":205,"title":206,"body":207,"category":1376,"date":1377,"description":255,"embedImage":1376,"extension":1378,"image":1376,"intro":1379,"meta":1380,"navigation":355,"path":1381,"seo":1382,"series":1376,"sitemap":1383,"stem":1384,"tags":1385,"__hash__":1390},"content\u002F2021\u002F05\u002F19\u002Fteensy-4-with-fastled.md","Teensy 4 with FastLED",{"type":208,"value":209,"toc":1369},"minimark",[210,215,219,222,225,228,232,235,249,312,321,327,371,376,455,460,469,510,513,515,519,528,531,534,540,587,593,598,606,1009,1013,1057,1061,1064,1067,1365],[211,212,214],"h2",{"id":213},"the-issue","The issue",[216,217,218],"p",{},"I have never managed to get a Teensy 4.0 or 4.1 microcontroller to run a vanilla FastLED program properly.",[216,220,221],{},"Either all LEDS are lit white or - a sequence starts - then hangs very soon after startup.",[216,223,224],{},"However - I have managed to get it to run using two different external libraries.",[226,227],"hr",{},[211,229,231],{"id":230},"ws2812serial","WS2812Serial",[216,233,234],{},"The WS2812Serial library comes with Teensyduino. It can be used along with FastLED to control the LEDs.",[216,236,237,238,248],{},"For PlatformIO - the ",[239,240,247],"a",{"href":241,"rel":242,"target":246},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Fteensy4_fastled\u002Fblob\u002Fmain\u002Fserial\u002Fplatformio.ini",[243,244,245],"nofollow","noopener","noreferer","_blank","following config"," is needed:",[250,251,256],"pre",{"className":252,"code":253,"language":254,"meta":255,"style":255},"language-ini shiki shiki-themes github-dark","[env:teensy40]\nplatform = teensy\nboard = teensy40\nframework = arduino\nlib_deps =\n    FastLED\n","ini","",[257,258,259,268,279,288,297,306],"code",{"__ignoreMap":255},[260,261,264],"span",{"class":262,"line":263},"line",1,[260,265,267],{"class":266},"svObZ","[env:teensy40]\n",[260,269,271,275],{"class":262,"line":270},2,[260,272,274],{"class":273},"snl16","platform",[260,276,278],{"class":277},"s95oV"," = teensy\n",[260,280,282,285],{"class":262,"line":281},3,[260,283,284],{"class":273},"board",[260,286,287],{"class":277}," = teensy40\n",[260,289,291,294],{"class":262,"line":290},4,[260,292,293],{"class":273},"framework",[260,295,296],{"class":277}," = arduino\n",[260,298,300,303],{"class":262,"line":299},5,[260,301,302],{"class":273},"lib_deps",[260,304,305],{"class":277}," =\n",[260,307,309],{"class":262,"line":308},6,[260,310,311],{"class":277},"    FastLED\n",[216,313,314,315,320],{},"Then the actual ",[239,316,319],{"href":317,"rel":318,"target":246},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Fteensy4_fastled\u002Fblob\u002Fmain\u002Fserial\u002Fmain.cpp",[243,244,245],"arduino program",":",[216,322,323],{},[324,325,326],"strong",{},"Includes",[250,328,332],{"className":329,"code":330,"language":331,"meta":255,"style":255},"language-cpp shiki shiki-themes github-dark","#include \u003CWS2812Serial.h>\n#define USE_WS2812SERIAL\n\n#define FASTLED_INTERNAL\n#include \u003CFastLED.h>\n","cpp",[257,333,334,343,351,357,364],{"__ignoreMap":255},[260,335,336,339],{"class":262,"line":263},[260,337,338],{"class":273},"#include",[260,340,342],{"class":341},"sU2Wk"," \u003CWS2812Serial.h>\n",[260,344,345,348],{"class":262,"line":270},[260,346,347],{"class":273},"#define",[260,349,350],{"class":266}," USE_WS2812SERIAL\n",[260,352,353],{"class":262,"line":281},[260,354,356],{"emptyLinePlaceholder":355},true,"\n",[260,358,359,361],{"class":262,"line":290},[260,360,347],{"class":273},[260,362,363],{"class":266}," FASTLED_INTERNAL\n",[260,365,366,368],{"class":262,"line":299},[260,367,338],{"class":273},[260,369,370],{"class":341}," \u003CFastLED.h>\n",[216,372,373],{},[324,374,375],{},"Setup",[250,377,379],{"className":329,"code":378,"language":331,"meta":255,"style":255},"#define NUM_LEDS 240\n\n#define LED_PIN 1\n\nCRGB leds[NUM_LEDS];\n\nvoid setup() {\n    FastLED.addLeds\u003CWS2812SERIAL, LED_PIN, GRB>(leds, NUM_LEDS);\n}\n",[257,380,381,392,396,406,410,415,419,431,449],{"__ignoreMap":255},[260,382,383,385,388],{"class":262,"line":263},[260,384,347],{"class":273},[260,386,387],{"class":266}," NUM_LEDS",[260,389,391],{"class":390},"sDLfK"," 240\n",[260,393,394],{"class":262,"line":270},[260,395,356],{"emptyLinePlaceholder":355},[260,397,398,400,403],{"class":262,"line":281},[260,399,347],{"class":273},[260,401,402],{"class":266}," LED_PIN",[260,404,405],{"class":390}," 1\n",[260,407,408],{"class":262,"line":290},[260,409,356],{"emptyLinePlaceholder":355},[260,411,412],{"class":262,"line":299},[260,413,414],{"class":277},"CRGB leds[NUM_LEDS];\n",[260,416,417],{"class":262,"line":308},[260,418,356],{"emptyLinePlaceholder":355},[260,420,422,425,428],{"class":262,"line":421},7,[260,423,424],{"class":273},"void",[260,426,427],{"class":266}," setup",[260,429,430],{"class":277},"() {\n",[260,432,434,437,440,443,446],{"class":262,"line":433},8,[260,435,436],{"class":277},"    FastLED.addLeds",[260,438,439],{"class":273},"\u003C",[260,441,442],{"class":277},"WS2812SERIAL, LED_PIN, GRB",[260,444,445],{"class":273},">",[260,447,448],{"class":277},"(leds, NUM_LEDS);\n",[260,450,452],{"class":262,"line":451},9,[260,453,454],{"class":277},"}\n",[456,457,459],"h3",{"id":458},"limitations","Limitations",[216,461,462,463,468],{},"You must use a serial pin - from ",[239,464,467],{"href":465,"rel":466,"target":246},"https:\u002F\u002Fgithub.com\u002FPaulStoffregen\u002FWS2812Serial\u002Fblob\u002Fmaster\u002Fexamples\u002FFastLED_Cylon\u002FFastLED_Cylon.ino",[243,244,245],"this example"," we can see:",[250,470,472],{"className":329,"code":471,"language":331,"meta":255,"style":255},"\u002F\u002F Usable pins:\n\u002F\u002F   Teensy LC:   1, 4, 5, 24\n\u002F\u002F   Teensy 3.2:  1, 5, 8, 10, 31   (overclock to 120 MHz for pin 8)\n\u002F\u002F   Teensy 3.5:  1, 5, 8, 10, 26, 32, 33, 48\n\u002F\u002F   Teensy 3.6:  1, 5, 8, 10, 26, 32, 33\n\u002F\u002F   Teensy 4.0:  1, 8, 14, 17, 20, 24, 29, 39\n\u002F\u002F   Teensy 4.1:  1, 8, 14, 17, 20, 24, 29, 35, 47, 53\n",[257,473,474,480,485,490,495,500,505],{"__ignoreMap":255},[260,475,476],{"class":262,"line":263},[260,477,479],{"class":478},"sAwPA","\u002F\u002F Usable pins:\n",[260,481,482],{"class":262,"line":270},[260,483,484],{"class":478},"\u002F\u002F   Teensy LC:   1, 4, 5, 24\n",[260,486,487],{"class":262,"line":281},[260,488,489],{"class":478},"\u002F\u002F   Teensy 3.2:  1, 5, 8, 10, 31   (overclock to 120 MHz for pin 8)\n",[260,491,492],{"class":262,"line":290},[260,493,494],{"class":478},"\u002F\u002F   Teensy 3.5:  1, 5, 8, 10, 26, 32, 33, 48\n",[260,496,497],{"class":262,"line":299},[260,498,499],{"class":478},"\u002F\u002F   Teensy 3.6:  1, 5, 8, 10, 26, 32, 33\n",[260,501,502],{"class":262,"line":308},[260,503,504],{"class":478},"\u002F\u002F   Teensy 4.0:  1, 8, 14, 17, 20, 24, 29, 39\n",[260,506,507],{"class":262,"line":421},[260,508,509],{"class":478},"\u002F\u002F   Teensy 4.1:  1, 8, 14, 17, 20, 24, 29, 35, 47, 53\n",[216,511,512],{},"I do not think you can run parallel strings with this setup.",[226,514],{},[211,516,518],{"id":517},"octows2811","OctoWS2811",[216,520,521,522,527],{},"This ",[239,523,526],{"href":524,"rel":525,"target":246},"https:\u002F\u002Fblinkylights.blog\u002F2021\u002F02\u002F03\u002Fusing-teensy-4-1-with-fastled\u002F",[243,244,245],"blog post on blinkylights.blog"," shows an approach using OctoWS2811 together with FastLED.",[216,529,530],{},"The code here is heavily based on that - just replaces RGB with GRB (as the blog post notes - \"There is a minor bug in this code where I ignore the RGB_ORDER parameter in setting r, g, and b. You can fix this if your strip uses GRB order or other.\")",[216,532,533],{},"OctoWS2811 hasn't had a release in a while - the last one (1.4) says support for Teensy 3.5\u002F3.6 - so this uses the github version.",[216,535,237,536,248],{},[239,537,247],{"href":538,"rel":539,"target":246},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Fteensy4_fastled\u002Fblob\u002Fmain\u002Focto\u002Fplatformio.ini",[243,244,245],[250,541,543],{"className":252,"code":542,"language":254,"meta":255,"style":255},"[env:teensy40]\nplatform = teensy\nboard = teensy40\nframework = arduino\nlib_deps =\n    SPI\n    FastLED\n    https:\u002F\u002Fgithub.com\u002FPaulStoffregen\u002FOctoWS2811\n",[257,544,545,549,555,561,567,573,578,582],{"__ignoreMap":255},[260,546,547],{"class":262,"line":263},[260,548,267],{"class":266},[260,550,551,553],{"class":262,"line":270},[260,552,274],{"class":273},[260,554,278],{"class":277},[260,556,557,559],{"class":262,"line":281},[260,558,284],{"class":273},[260,560,287],{"class":277},[260,562,563,565],{"class":262,"line":290},[260,564,293],{"class":273},[260,566,296],{"class":277},[260,568,569,571],{"class":262,"line":299},[260,570,302],{"class":273},[260,572,305],{"class":277},[260,574,575],{"class":262,"line":308},[260,576,577],{"class":277},"    SPI\n",[260,579,580],{"class":262,"line":421},[260,581,311],{"class":277},[260,583,584],{"class":262,"line":433},[260,585,586],{"class":277},"    https:\u002F\u002Fgithub.com\u002FPaulStoffregen\u002FOctoWS2811\n",[216,588,314,589,320],{},[239,590,319],{"href":591,"rel":592,"target":246},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Fteensy4_fastled\u002Fblob\u002Fmain\u002Focto\u002Fmain.cpp",[243,244,245],[216,594,595],{},[324,596,597],{},"Custom Controller",[216,599,521,600,605],{},[239,601,604],{"href":602,"rel":603,"target":246},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Fteensy4_fastled\u002Fblob\u002Fmain\u002Focto\u002FCTeensy4Controller.h",[243,244,245],"custom controller"," is the same as the one from the blinkylights blog just adjusted to work with GRB order.",[250,607,609],{"className":329,"code":608,"language":331,"meta":255,"style":255},"#include \u003COctoWS2811.h>\n#include \u003CFastLED.h>\n#include \u003CArduino.h>\n\ntemplate \u003CEOrder RGB_ORDER = RGB,\n          uint8_t CHIP = WS2811_800kHz>\nclass CTeensy4Controller : public CPixelLEDController\u003CRGB_ORDER, 8, 0xFF>\n{\n    OctoWS2811 *pocto;\n\npublic:\n    CTeensy4Controller(OctoWS2811 *_pocto)\n        : pocto(_pocto){};\n\n    virtual void init() {}\n    virtual void showPixels(PixelController\u003CRGB_ORDER, 8, 0xFF> &pixels)\n    {\n\n        uint32_t i = 0;\n        while (pixels.has(1))\n        {\n            uint8_t g = pixels.loadAndScale0();\n            uint8_t r = pixels.loadAndScale1();\n            uint8_t b = pixels.loadAndScale2();\n            pocto->setPixel(i++, r, g, b);\n            pixels.stepDithering();\n            pixels.advanceData();\n        }\n\n        pocto->show();\n    }\n};\n",[257,610,611,618,624,631,635,655,668,707,712,723,728,734,755,767,772,787,827,833,838,856,876,882,902,919,936,954,965,975,981,986,997,1003],{"__ignoreMap":255},[260,612,613,615],{"class":262,"line":263},[260,614,338],{"class":273},[260,616,617],{"class":341}," \u003COctoWS2811.h>\n",[260,619,620,622],{"class":262,"line":270},[260,621,338],{"class":273},[260,623,370],{"class":341},[260,625,626,628],{"class":262,"line":281},[260,627,338],{"class":273},[260,629,630],{"class":341}," \u003CArduino.h>\n",[260,632,633],{"class":262,"line":290},[260,634,356],{"emptyLinePlaceholder":355},[260,636,637,640,643,646,649,652],{"class":262,"line":299},[260,638,639],{"class":273},"template",[260,641,642],{"class":277}," \u003C",[260,644,645],{"class":273},"EOrder",[260,647,648],{"class":266}," RGB_ORDER",[260,650,651],{"class":273}," =",[260,653,654],{"class":277}," RGB,\n",[260,656,657,660,663,665],{"class":262,"line":308},[260,658,659],{"class":273},"          uint8_t",[260,661,662],{"class":266}," CHIP",[260,664,651],{"class":273},[260,666,667],{"class":277}," WS2811_800kHz>\n",[260,669,670,673,676,679,682,685,687,690,693,696,698,701,704],{"class":262,"line":421},[260,671,672],{"class":273},"class",[260,674,675],{"class":266}," CTeensy4Controller",[260,677,678],{"class":277}," : ",[260,680,681],{"class":273},"public",[260,683,684],{"class":266}," CPixelLEDController",[260,686,439],{"class":277},[260,688,689],{"class":266},"RGB_ORDER",[260,691,692],{"class":277},", ",[260,694,695],{"class":390},"8",[260,697,692],{"class":277},[260,699,700],{"class":273},"0x",[260,702,703],{"class":390},"FF",[260,705,706],{"class":277},">\n",[260,708,709],{"class":262,"line":433},[260,710,711],{"class":277},"{\n",[260,713,714,717,720],{"class":262,"line":451},[260,715,716],{"class":277},"    OctoWS2811 ",[260,718,719],{"class":273},"*",[260,721,722],{"class":277},"pocto;\n",[260,724,726],{"class":262,"line":725},10,[260,727,356],{"emptyLinePlaceholder":355},[260,729,731],{"class":262,"line":730},11,[260,732,733],{"class":273},"public:\n",[260,735,737,740,743,745,748,752],{"class":262,"line":736},12,[260,738,739],{"class":266},"    CTeensy4Controller",[260,741,742],{"class":277},"(",[260,744,518],{"class":266},[260,746,747],{"class":273}," *",[260,749,751],{"class":750},"s9osk","_pocto",[260,753,754],{"class":277},")\n",[260,756,758,761,764],{"class":262,"line":757},13,[260,759,760],{"class":277},"        : ",[260,762,763],{"class":266},"pocto",[260,765,766],{"class":277},"(_pocto){};\n",[260,768,770],{"class":262,"line":769},14,[260,771,356],{"emptyLinePlaceholder":355},[260,773,775,778,781,784],{"class":262,"line":774},15,[260,776,777],{"class":273},"    virtual",[260,779,780],{"class":273}," void",[260,782,783],{"class":266}," init",[260,785,786],{"class":277},"() {}\n",[260,788,790,792,794,797,799,802,804,806,808,810,812,814,816,819,822,825],{"class":262,"line":789},16,[260,791,777],{"class":273},[260,793,780],{"class":273},[260,795,796],{"class":266}," showPixels",[260,798,742],{"class":277},[260,800,801],{"class":266},"PixelController",[260,803,439],{"class":277},[260,805,689],{"class":266},[260,807,692],{"class":277},[260,809,695],{"class":390},[260,811,692],{"class":277},[260,813,700],{"class":273},[260,815,703],{"class":390},[260,817,818],{"class":277},"> ",[260,820,821],{"class":273},"&",[260,823,824],{"class":750},"pixels",[260,826,754],{"class":277},[260,828,830],{"class":262,"line":829},17,[260,831,832],{"class":277},"    {\n",[260,834,836],{"class":262,"line":835},18,[260,837,356],{"emptyLinePlaceholder":355},[260,839,841,844,847,850,853],{"class":262,"line":840},19,[260,842,843],{"class":273},"        uint32_t",[260,845,846],{"class":277}," i ",[260,848,849],{"class":273},"=",[260,851,852],{"class":390}," 0",[260,854,855],{"class":277},";\n",[260,857,859,862,865,868,870,873],{"class":262,"line":858},20,[260,860,861],{"class":273},"        while",[260,863,864],{"class":277}," (pixels.",[260,866,867],{"class":266},"has",[260,869,742],{"class":277},[260,871,872],{"class":390},"1",[260,874,875],{"class":277},"))\n",[260,877,879],{"class":262,"line":878},21,[260,880,881],{"class":277},"        {\n",[260,883,885,888,891,893,896,899],{"class":262,"line":884},22,[260,886,887],{"class":273},"            uint8_t",[260,889,890],{"class":277}," g ",[260,892,849],{"class":273},[260,894,895],{"class":277}," pixels.",[260,897,898],{"class":266},"loadAndScale0",[260,900,901],{"class":277},"();\n",[260,903,905,907,910,912,914,917],{"class":262,"line":904},23,[260,906,887],{"class":273},[260,908,909],{"class":277}," r ",[260,911,849],{"class":273},[260,913,895],{"class":277},[260,915,916],{"class":266},"loadAndScale1",[260,918,901],{"class":277},[260,920,922,924,927,929,931,934],{"class":262,"line":921},24,[260,923,887],{"class":273},[260,925,926],{"class":277}," b ",[260,928,849],{"class":273},[260,930,895],{"class":277},[260,932,933],{"class":266},"loadAndScale2",[260,935,901],{"class":277},[260,937,939,942,945,948,951],{"class":262,"line":938},25,[260,940,941],{"class":277},"            pocto->",[260,943,944],{"class":266},"setPixel",[260,946,947],{"class":277},"(i",[260,949,950],{"class":273},"++",[260,952,953],{"class":277},", r, g, b);\n",[260,955,957,960,963],{"class":262,"line":956},26,[260,958,959],{"class":277},"            pixels.",[260,961,962],{"class":266},"stepDithering",[260,964,901],{"class":277},[260,966,968,970,973],{"class":262,"line":967},27,[260,969,959],{"class":277},[260,971,972],{"class":266},"advanceData",[260,974,901],{"class":277},[260,976,978],{"class":262,"line":977},28,[260,979,980],{"class":277},"        }\n",[260,982,984],{"class":262,"line":983},29,[260,985,356],{"emptyLinePlaceholder":355},[260,987,989,992,995],{"class":262,"line":988},30,[260,990,991],{"class":277},"        pocto->",[260,993,994],{"class":266},"show",[260,996,901],{"class":277},[260,998,1000],{"class":262,"line":999},31,[260,1001,1002],{"class":277},"    }\n",[260,1004,1006],{"class":262,"line":1005},32,[260,1007,1008],{"class":277},"};\n",[216,1010,1011],{},[324,1012,326],{},[250,1014,1016],{"className":329,"code":1015,"language":331,"meta":255,"style":255},"#include \u003CArduino.h>\n#include \u003COctoWS2811.h>\n\n#define FASTLED_INTERNAL\n#include \u003CFastLED.h>\n\n#include \"CTeensy4Controller.h\"\n",[257,1017,1018,1024,1030,1034,1040,1046,1050],{"__ignoreMap":255},[260,1019,1020,1022],{"class":262,"line":263},[260,1021,338],{"class":273},[260,1023,630],{"class":341},[260,1025,1026,1028],{"class":262,"line":270},[260,1027,338],{"class":273},[260,1029,617],{"class":341},[260,1031,1032],{"class":262,"line":281},[260,1033,356],{"emptyLinePlaceholder":355},[260,1035,1036,1038],{"class":262,"line":290},[260,1037,347],{"class":273},[260,1039,363],{"class":266},[260,1041,1042,1044],{"class":262,"line":299},[260,1043,338],{"class":273},[260,1045,370],{"class":341},[260,1047,1048],{"class":262,"line":308},[260,1049,356],{"emptyLinePlaceholder":355},[260,1051,1052,1054],{"class":262,"line":421},[260,1053,338],{"class":273},[260,1055,1056],{"class":341}," \"CTeensy4Controller.h\"\n",[216,1058,1059],{},[324,1060,375],{},[216,1062,1063],{},"This sets up for a single string. However - by adjusting numPins to match the number of parallel strings (and adding the pin numbers to pinList) this can be run in parallel.",[216,1065,1066],{},"Code here is also mostly taken directly from the blinkylights blog - but sets up for GRB order.",[250,1068,1070],{"className":329,"code":1069,"language":331,"meta":255,"style":255},"const int numPins = 1;\nbyte pinList[numPins] = {1};\n\nconst int ledsPerStrip = 240;\nCRGB leds[numPins * ledsPerStrip];\n\n\u002F\u002F These buffers need to be large enough for all the pixels.\n\u002F\u002F The total number of pixels is \"ledsPerStrip * numPins\".\n\u002F\u002F Each pixel needs 3 bytes, so multiply by 3.  An \"int\" is\n\u002F\u002F 4 bytes, so divide by 4.  The array is created using \"int\"\n\u002F\u002F so the compiler will align it to 32 bit memory.\nDMAMEM int displayMemory[ledsPerStrip * numPins * 3 \u002F 4];\nint drawingMemory[ledsPerStrip * numPins * 3 \u002F 4];\n\nOctoWS2811 octo(ledsPerStrip, displayMemory, drawingMemory, WS2811_GRB | WS2811_800kHz, numPins, pinList);\n\nCTeensy4Controller\u003CGRB, WS2811_800kHz> *pcontroller;\n\nvoid setup()\n{\n  octo.begin();\n  pcontroller = new CTeensy4Controller\u003CGRB, WS2811_800kHz>(&octo);\n\n  FastLED.addLeds(pcontroller, leds, numPins * ledsPerStrip);\n}\n",[257,1071,1072,1090,1104,1108,1124,1134,1138,1143,1148,1153,1158,1163,1192,1213,1217,1263,1267,1284,1288,1297,1301,1311,1341,1345,1361],{"__ignoreMap":255},[260,1073,1074,1077,1080,1083,1085,1088],{"class":262,"line":263},[260,1075,1076],{"class":273},"const",[260,1078,1079],{"class":273}," int",[260,1081,1082],{"class":277}," numPins ",[260,1084,849],{"class":273},[260,1086,1087],{"class":390}," 1",[260,1089,855],{"class":277},[260,1091,1092,1095,1097,1100,1102],{"class":262,"line":270},[260,1093,1094],{"class":277},"byte pinList[numPins] ",[260,1096,849],{"class":273},[260,1098,1099],{"class":277}," {",[260,1101,872],{"class":390},[260,1103,1008],{"class":277},[260,1105,1106],{"class":262,"line":281},[260,1107,356],{"emptyLinePlaceholder":355},[260,1109,1110,1112,1114,1117,1119,1122],{"class":262,"line":290},[260,1111,1076],{"class":273},[260,1113,1079],{"class":273},[260,1115,1116],{"class":277}," ledsPerStrip ",[260,1118,849],{"class":273},[260,1120,1121],{"class":390}," 240",[260,1123,855],{"class":277},[260,1125,1126,1129,1131],{"class":262,"line":299},[260,1127,1128],{"class":277},"CRGB leds[numPins ",[260,1130,719],{"class":273},[260,1132,1133],{"class":277}," ledsPerStrip];\n",[260,1135,1136],{"class":262,"line":308},[260,1137,356],{"emptyLinePlaceholder":355},[260,1139,1140],{"class":262,"line":421},[260,1141,1142],{"class":478},"\u002F\u002F These buffers need to be large enough for all the pixels.\n",[260,1144,1145],{"class":262,"line":433},[260,1146,1147],{"class":478},"\u002F\u002F The total number of pixels is \"ledsPerStrip * numPins\".\n",[260,1149,1150],{"class":262,"line":451},[260,1151,1152],{"class":478},"\u002F\u002F Each pixel needs 3 bytes, so multiply by 3.  An \"int\" is\n",[260,1154,1155],{"class":262,"line":725},[260,1156,1157],{"class":478},"\u002F\u002F 4 bytes, so divide by 4.  The array is created using \"int\"\n",[260,1159,1160],{"class":262,"line":730},[260,1161,1162],{"class":478},"\u002F\u002F so the compiler will align it to 32 bit memory.\n",[260,1164,1165,1168,1171,1174,1176,1178,1180,1183,1186,1189],{"class":262,"line":736},[260,1166,1167],{"class":277},"DMAMEM ",[260,1169,1170],{"class":273},"int",[260,1172,1173],{"class":277}," displayMemory[ledsPerStrip ",[260,1175,719],{"class":273},[260,1177,1082],{"class":277},[260,1179,719],{"class":273},[260,1181,1182],{"class":390}," 3",[260,1184,1185],{"class":273}," \u002F",[260,1187,1188],{"class":390}," 4",[260,1190,1191],{"class":277},"];\n",[260,1193,1194,1196,1199,1201,1203,1205,1207,1209,1211],{"class":262,"line":757},[260,1195,1170],{"class":273},[260,1197,1198],{"class":277}," drawingMemory[ledsPerStrip ",[260,1200,719],{"class":273},[260,1202,1082],{"class":277},[260,1204,719],{"class":273},[260,1206,1182],{"class":390},[260,1208,1185],{"class":273},[260,1210,1188],{"class":390},[260,1212,1191],{"class":277},[260,1214,1215],{"class":262,"line":769},[260,1216,356],{"emptyLinePlaceholder":355},[260,1218,1219,1221,1224,1226,1229,1231,1234,1236,1239,1241,1244,1247,1250,1252,1255,1257,1260],{"class":262,"line":774},[260,1220,518],{"class":266},[260,1222,1223],{"class":266}," octo",[260,1225,742],{"class":277},[260,1227,1228],{"class":266},"ledsPerStrip",[260,1230,692],{"class":277},[260,1232,1233],{"class":266},"displayMemory",[260,1235,692],{"class":277},[260,1237,1238],{"class":266},"drawingMemory",[260,1240,692],{"class":277},[260,1242,1243],{"class":266},"WS2811_GRB",[260,1245,1246],{"class":273}," |",[260,1248,1249],{"class":750}," WS2811_800kHz",[260,1251,692],{"class":277},[260,1253,1254],{"class":266},"numPins",[260,1256,692],{"class":277},[260,1258,1259],{"class":266},"pinList",[260,1261,1262],{"class":277},");\n",[260,1264,1265],{"class":262,"line":789},[260,1266,356],{"emptyLinePlaceholder":355},[260,1268,1269,1272,1274,1277,1279,1281],{"class":262,"line":829},[260,1270,1271],{"class":277},"CTeensy4Controller",[260,1273,439],{"class":273},[260,1275,1276],{"class":277},"GRB, WS2811_800kHz",[260,1278,445],{"class":273},[260,1280,747],{"class":273},[260,1282,1283],{"class":277},"pcontroller;\n",[260,1285,1286],{"class":262,"line":835},[260,1287,356],{"emptyLinePlaceholder":355},[260,1289,1290,1292,1294],{"class":262,"line":840},[260,1291,424],{"class":273},[260,1293,427],{"class":266},[260,1295,1296],{"class":277},"()\n",[260,1298,1299],{"class":262,"line":858},[260,1300,711],{"class":277},[260,1302,1303,1306,1309],{"class":262,"line":878},[260,1304,1305],{"class":277},"  octo.",[260,1307,1308],{"class":266},"begin",[260,1310,901],{"class":277},[260,1312,1313,1316,1318,1321,1323,1325,1328,1330,1333,1336,1338],{"class":262,"line":884},[260,1314,1315],{"class":277},"  pcontroller ",[260,1317,849],{"class":273},[260,1319,1320],{"class":273}," new",[260,1322,675],{"class":266},[260,1324,439],{"class":277},[260,1326,1327],{"class":266},"GRB",[260,1329,692],{"class":277},[260,1331,1332],{"class":266},"WS2811_800kHz",[260,1334,1335],{"class":277},">(",[260,1337,821],{"class":273},[260,1339,1340],{"class":277},"octo);\n",[260,1342,1343],{"class":262,"line":904},[260,1344,356],{"emptyLinePlaceholder":355},[260,1346,1347,1350,1353,1356,1358],{"class":262,"line":921},[260,1348,1349],{"class":277},"  FastLED.",[260,1351,1352],{"class":266},"addLeds",[260,1354,1355],{"class":277},"(pcontroller, leds, numPins ",[260,1357,719],{"class":273},[260,1359,1360],{"class":277}," ledsPerStrip);\n",[260,1362,1363],{"class":262,"line":938},[260,1364,454],{"class":277},[1366,1367,1368],"style",{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}",{"title":255,"searchDepth":270,"depth":270,"links":1370},[1371,1372,1375],{"id":213,"depth":270,"text":214},{"id":230,"depth":270,"text":231,"children":1373},[1374],{"id":458,"depth":281,"text":459},{"id":517,"depth":270,"text":518},null,"2021-05-19 08:06 +0200","md","Getting FastLED programs to run on teensy 4.0 and 4.1 with either WS2812Serial or OctoWS2811",{},"\u002F2021\u002F05\u002F19\u002Fteensy-4-with-fastled",{"title":206,"description":255},{"loc":1381},"2021\u002F05\u002F19\u002Fteensy-4-with-fastled",[1386,1387,1388,1389,517],"arduino","platformio","fastled","ws2812b","ExO4NNOF3P-Fr07ehU4FctINh3DMtymZaIACw_5sn38",1775293006031]