[{"data":1,"prerenderedAt":54},["ShallowReactive",2],{"example-page-uno-neopixel":3},{"id":4,"info":5,"parts":6,"wired":14,"refs":15,"nets":16,"moreNets":48,"code":49},"uno-neopixel","A ring of 12 WS2812B LEDs (NeoPixel) on D6 runs color wipes and a rainbow with the Adafruit NeoPixel library. The ATmega328P has no special hardware for this: the library sends the 800 kHz signal by toggling the pin with exact instruction timing, and the LEDs decode it from the voltage in the simulation. Potentiometer RV1 on A0 sets the speed. Put the logic analyzer on DIN to see the bits.",[7,10,12],[8,9],"arduino_uno",1,[11,9],"pot",[13,9],"ws2812_strip",false,{"A1":8,"LED1":13,"RV1":11},[17,28,35,41],{"name":18,"pins":19},"0",[20,23,25],[21,22],"A1","GND",[24,22],"LED1",[26,27],"RV1","2",{"name":29,"pins":30},"5V",[31,32,33],[21,29],[24,29],[26,34],"1",{"name":36,"pins":37},"DIN",[38,40],[21,39],"~D6",[24,36],{"name":42,"pins":43},"POT",[44,46],[21,45],"A0",[26,47],"W",0,{"file":50,"lang":51,"text":52,"lines":53,"more":14},"sketch.ino","cpp","\u002F\u002F 12-LED NeoPixel ring (WS2812B) on D6, speed from the potentiometer on A0.\n\u002F\u002F Adafruit_NeoPixel bit-bangs the 800 kHz signal with exact cycle timing (interrupts off per frame).\n#include \u003CAdafruit_NeoPixel.h>\nconst int PIN = 6, COUNT = 12;\nAdafruit_NeoPixel ring(COUNT, PIN, NEO_GRB + NEO_KHZ800);\n\nint pause() { return map(analogRead(A0), 0, 1023, 5, 120); }   \u002F\u002F ms per step\n\nvoid wipe(uint32_t color) {\n  for (int i = 0; i \u003C COUNT; i++) { ring.setPixelColor(i, color); ring.show(); delay(pause()); }\n}\n\nvoid setup() {\n  Serial.begin(115200);\n  ring.begin();\n  ring.setBrightness(80);\n  Serial.println(F(\"NeoPixel ring ready\"));\n}\n\nvoid loop() {\n  wipe(ring.Color(255, 0, 0)); wipe(ring.Color(0, 255, 0)); wipe(ring.Color(0, 0, 255));\n  Serial.println(F(\"rainbow\"));\n  for (long hue = 0; hue \u003C 65536; hue += 2048) {\n    for (int i = 0; i \u003C COUNT; i++) ring.setPixelColor(i, ring.gamma32(ring.ColorHSV(hue + i * 65536L \u002F COUNT)));\n    ring.show();\n    delay(pause());\n  }\n}",28,1796304409795]