@dplum7 ...
An example of text formatting...
"parts": [ { "type": "wokwi-arduino-nano", "id": "nano", "top": -100, "left": 100, "rotate": 0, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb1", "top": 0, "left": 120, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb2", "top": 0, "left": 140, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb3", "top": 0, "left": 160, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb4", "top": 0, "left": 180, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb5", "top": 0, "left": 200, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb6", "top": 0, "left": 220, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb7", "top": 0, "left": 240, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb8", "top": 0, "left": 260, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb9", "top": 0, "left": 280, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb10", "top": 0, "left": 300, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb11", "top": 0, "left": 320, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb12", "top": 0, "left": 340, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb13", "top": 0, "left": 360, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb14", "top": 0, "left": 380, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb15", "top": 0, "left": 400, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb16", "top": 0, "left": 420, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb17", "top": 0, "left": 440, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb18", "top": 0, "left": 460, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb19", "top": 0, "left": 480, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb20", "top": 0, "left": 500, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb21", "top": 0, "left": 520, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb22", "top": 0, "left": 540, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb23", "top": 0, "left": 560, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb24", "top": 0, "left": 580, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb25", "top": 0, "left": 600, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb26", "top": 0, "left": 620, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb27", "top": 0, "left": 640, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb28", "top": 0, "left": 660, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb29", "top": 0, "left": 680, "rotate": 270, "attrs": {} },
{ "type": "wokwi-neopixel", "id": "rgb30", "top": 0, "left": 700, "rotate": 270, "attrs": {} }
],
"connections": [
["rgb1:DOUT","rgb2:DIN","green",["h5","v-20"]],["rgb1:VSS","rgb2:VSS","black",["h0"]],["rgb1:VDD","rgb2:VDD","red",["v0"]],
["rgb2:DOUT","rgb3:DIN","green",["h5","v-20"]],["rgb2:VSS","rgb3:VSS","black",["h0"]],["rgb2:VDD","rgb3:VDD","red",["v0"]],
["rgb3:DOUT","rgb4:DIN","green",["h5","v-20"]],["rgb3:VSS","rgb4:VSS","black",["h0"]],["rgb3:VDD","rgb4:VDD","red",["v0"]],
["rgb4:DOUT","rgb5:DIN","green",["h5","v-20"]],["rgb4:VSS","rgb5:VSS","black",["h0"]],["rgb4:VDD","rgb5:VDD","red",["v0"]],
["rgb5:DOUT","rgb6:DIN","green",["h5","v-20"]],["rgb5:VSS","rgb6:VSS","black",["h0"]],["rgb5:VDD","rgb6:VDD","red",["v0"]],
["rgb6:DOUT","rgb7:DIN","green",["h5","v-20"]],["rgb6:VSS","rgb7:VSS","black",["h0"]],["rgb6:VDD","rgb7:VDD","red",["v0"]],
["rgb7:DOUT","rgb8:DIN","green",["h5","v-20"]],["rgb7:VSS","rgb8:VSS","black",["h0"]],["rgb7:VDD","rgb8:VDD","red",["v0"]],
["rgb8:DOUT","rgb9:DIN","green",["h5","v-20"]],["rgb8:VSS","rgb9:VSS","black",["h0"]],["rgb8:VDD","rgb9:VDD","red",["v0"]],
["rgb9:DOUT","rgb10:DIN","green",["h5","v-20"]],["rgb9:VSS","rgb10:VSS","black",["h0"]],["rgb9:VDD","rgb10:VDD","red",["v0"]],
["rgb10:DOUT","rgb11:DIN","green",["h5","v-20"]],["rgb10:VSS","rgb11:VSS","black",["h0"]],["rgb10:VDD","rgb11:VDD","red",["v0"]],
["rgb11:DOUT","rgb12:DIN","green",["h5","v-20"]],["rgb11:VSS","rgb12:VSS","black",["h0"]],["rgb11:VDD","rgb12:VDD","red",["v0"]],
["rgb12:DOUT","rgb13:DIN","green",["h5","v-20"]],["rgb12:VSS","rgb13:VSS","black",["h0"]],["rgb12:VDD","rgb13:VDD","red",["v0"]],
["rgb13:DOUT","rgb14:DIN","green",["h5","v-20"]],["rgb13:VSS","rgb14:VSS","black",["h0"]],["rgb13:VDD","rgb14:VDD","red",["v0"]],
["rgb14:DOUT","rgb15:DIN","green",["h5","v-20"]],["rgb14:VSS","rgb15:VSS","black",["h0"]],["rgb14:VDD","rgb15:VDD","red",["v0"]],
["rgb15:DOUT","rgb16:DIN","green",["h5","v-20"]],["rgb15:VSS","rgb16:VSS","black",["h0"]],["rgb15:VDD","rgb16:VDD","red",["v0"]],
["rgb16:DOUT","rgb17:DIN","green",["h5","v-20"]],["rgb16:VSS","rgb17:VSS","black",["h0"]],["rgb16:VDD","rgb17:VDD","red",["v0"]],
["rgb17:DOUT","rgb18:DIN","green",["h5","v-20"]],["rgb17:VSS","rgb18:VSS","black",["h0"]],["rgb17:VDD","rgb18:VDD","red",["v0"]],
["rgb18:DOUT","rgb19:DIN","green",["h5","v-20"]],["rgb18:VSS","rgb19:VSS","black",["h0"]],["rgb18:VDD","rgb19:VDD","red",["v0"]],
["rgb19:DOUT","rgb20:DIN","green",["h5","v-20"]],["rgb19:VSS","rgb20:VSS","black",["h0"]],["rgb19:VDD","rgb20:VDD","red",["v0"]],
["rgb20:DOUT","rgb21:DIN","green",["h5","v-20"]],["rgb20:VSS","rgb21:VSS","black",["h0"]],["rgb20:VDD","rgb21:VDD","red",["v0"]],
["rgb21:DOUT","rgb22:DIN","green",["h5","v-20"]],["rgb21:VSS","rgb22:VSS","black",["h0"]],["rgb21:VDD","rgb22:VDD","red",["v0"]],
["rgb22:DOUT","rgb23:DIN","green",["h5","v-20"]],["rgb22:VSS","rgb23:VSS","black",["h0"]],["rgb22:VDD","rgb23:VDD","red",["v0"]],
["rgb23:DOUT","rgb24:DIN","green",["h5","v-20"]],["rgb23:VSS","rgb24:VSS","black",["h0"]],["rgb23:VDD","rgb24:VDD","red",["v0"]],
["rgb24:DOUT","rgb25:DIN","green",["h5","v-20"]],["rgb24:VSS","rgb25:VSS","black",["h0"]],["rgb24:VDD","rgb25:VDD","red",["v0"]],
["rgb25:DOUT","rgb26:DIN","green",["h5","v-20"]],["rgb25:VSS","rgb26:VSS","black",["h0"]],["rgb25:VDD","rgb26:VDD","red",["v0"]],
["rgb26:DOUT","rgb27:DIN","green",["h5","v-20"]],["rgb26:VSS","rgb27:VSS","black",["h0"]],["rgb26:VDD","rgb27:VDD","red",["v0"]],
["rgb27:DOUT","rgb28:DIN","green",["h5","v-20"]],["rgb27:VSS","rgb28:VSS","black",["h0"]],["rgb27:VDD","rgb28:VDD","red",["v0"]],
["rgb28:DOUT","rgb29:DIN","green",["h5","v-20"]],["rgb28:VSS","rgb29:VSS","black",["h0"]],["rgb28:VDD","rgb29:VDD","red",["v0"]],
["rgb29:DOUT","rgb30:DIN","green",["h5","v-20"]],["rgb29:VSS","rgb30:VSS","black",["h0"]],["rgb29:VDD","rgb30:VDD","red",["v0"]]
],
From this code:
void parts() {
Serial.print(" \"parts\": [ { \"type\": \"wokwi-arduino-nano\", \"id\": \"nano\", \"top\": -100, \"left\": ");
Serial.print(mcu); // put the mcu at the DIN end of the NeoPixel string
Serial.println(", \"rotate\": 0, \"attrs\": {} },"); // orient VSS and VDD for clean connection
for (int i = 1; i < number + 1; i++ ) {
Serial.print(" { \"type\": \"wokwi-neopixel\", \"id\": \"rgb");
Serial.print(i);
Serial.print("\", \"top\": 0, \"left\": ");
Serial.print(i * spacing + 100);
Serial.print(", \"rotate\": 270, \"attrs\": {} }"); // remove final comma
if (i < number)
Serial.print(","); // add final comma
Serial.println();
}
Serial.println(" ],");
}
void connections() {
Serial.println(" \"connections\": [");
for (int i = 1; i < number ; i++ ) { // one less connection than number of neopixels
Serial.print(" [\"rgb");
Serial.print(i);
Serial.print(":DOUT\",\"rgb");
Serial.print(i + 1);
Serial.print(":DIN\",\"green\",[\"h5\",\"v-20\"]],");
Serial.print("[\"rgb");
Serial.print(i);
Serial.print(":VSS\",\"rgb");
Serial.print(i + 1);
Serial.print(":VSS\",\"black\",[\"h0\"]],");
Serial.print("[\"rgb");
Serial.print(i);
Serial.print(":VDD\",\"rgb");
Serial.print(i + 1);
Serial.print(":VDD\",\"red\",[\"v0\"]]");
if (i < number - 1) // one less connection than number of neopixels
Serial.print(","); // add final comma when not final line
Serial.println();
}
Serial.println(" ],");
}