ronfrtek
Published © LGPL

Arduino Neopixel LED Ring Ws2812 - Visuino Tutorial

In this tutorial we will learn how to control the Neopixel Led Ring Ws2812 using Arduino and Visuino to run the LED pixel around.

BeginnerProtip1 hour2,256
Arduino Neopixel LED Ring Ws2812 - Visuino Tutorial

Things used in this project

Story

Read more

Code

neo-pixel.visuino

Arduino
{
  "Version": "2",
  "Product": "Visuino Pro - Visual Arduino Programming",
  "Units": [
    {
      "Name": "__OpenWireRootUnit__",
      "*": [
        {
          "X": 1008,
          "Name": "Arduino",
          "Instance": {
            "Serial": {
              "*": [
                {
                  "+": "TArduinoHardwareSerial"
                }
              ]
            },
            "+": "TArduinoBoard",
            "AnalogInputReference": "Default",
            "Modules": {
              "*": [
                {
                  "+": "TArduinoEEPROMModule"
                },
                {
                  "+": "TArduinoProcessor328Module"
                },
                {
                  "+": "TArduinoWatchdogTimerModule"
                }
              ]
            },
            "I2CChannels": {
              "*": [
                {
                  "+": "TArduinoI2C"
                }
              ]
            },
            "Digital": {
              "*": [
                {
                  "+": "TArduinoAdditionalDigitalSerial0Channel"
                },
                {
                  "+": "TArduinoAdditionalDigitalSerial0Channel"
                },
                {
                  "+": "TArduinoAdditionalDigitalInterruptChannel"
                },
                {
                  "+": "TArduinoBasicDigitalPWMInterruptChannel"
                },
                {
                  "+": "TArduinoAdditionalDigitalChannel"
                },
                {
                  "+": "TArduinoBasicDigitalPWMChannel"
                },
                {
                  "DigitalInputPin": {
                    "SourcePin": {
                      "ID": "__OpenWireRootUnit__.NeoPixels1.OutputPin"
                    }
                  },
                  "+": "TArduinoBasicDigitalPWMChannel"
                },
                {
                  "+": "TArduinoAdditionalDigitalChannel"
                },
                {
                  "+": "TArduinoAdditionalDigitalChannel"
                },
                {
                  "+": "TArduinoBasicDigitalPWMChannel"
                },
                {
                  "+": "TArduinoBasicDigitalPWMChannel"
                },
                {
                  "+": "TArduinoBasicDigitalPWMSPI0Channel"
                },
                {
                  "+": "TArduinoAdditionalDigitalSPI0Channel"
                },
                {
                  "+": "TArduinoAdditionalDigitalSPI0Channel"
                },
                {
                  "+": "TArduinoCombinedAnalogDigitalChannel"
                },
                {
                  "+": "TArduinoCombinedAnalogDigitalChannel"
                },
                {
                  "+": "TArduinoCombinedAnalogDigitalChannel"
                },
                {
                  "+": "TArduinoCombinedAnalogDigitalChannel"
                },
                {
                  "+": "TArduinoCombinedAnalogDigitalI2C0Channel"
                },
                {
                  "+": "TArduinoCombinedAnalogDigitalI2C0Channel"
                }
              ]
            },
            "SPIChannels": {
              "*": [
                {
                  "+": "TArduinoSPI"
                }
              ]
            },
            "BoardType": "Arduino Uno"
          },
          "Type": "Component",
          "Y": 432
        },
        {
          "X": 560,
          "Name": "Counter1",
          "Instance": {
            "Max": {
              "Value": 12
            },
            "Min": {
              "Value": 0
            },
            "InputPin": {
              "SourcePins": [
                {
                  "ID": "__OpenWireRootUnit__.ClockGenerator1.OutputPin"
                }
              ]
            },
            "+": "TArduinoCounter",
            "OutputPin": {
              "SinkPins": [
                {
                  "ID": "__OpenWireRootUnit__.CompareValue1.InputPin"
                },
                {
                  "Name": "__OpenWireRootUnit__.NeoPixels1.PixelGroups.Color Pixel1.IndexInputPin",
                  "ID": "__OpenWireRootUnit__.NeoPixels1.PixelGroups._Item0.IndexInputPin"
                }
              ]
            },
            "ResetInputPin": {
              "SourcePins": [
                {
                  "ID": "__OpenWireRootUnit__.CompareValue1.OutputPin"
                }
              ]
            }
          },
          "Type": "Component",
          "Y": 256
        },
        {
          "X": 800,
          "Name": "CompareValue1",
          "Instance": {
            "Value": 12,
            "OutputPin": {
              "SinkPins": [
                {
                  "ID": "__OpenWireRootUnit__.Counter1.ResetInputPin"
                },
                {
                  "ID": "__OpenWireRootUnit__.RandomRGBWColor1.ClockInputPin"
                }
              ]
            },
            "+": "TArduinoIntegerCompareValue",
            "Enabled": false,
            "CompareType": "ctNotEqual",
            "InputPin": {
              "SourcePin": {
                "ID": "__OpenWireRootUnit__.Counter1.OutputPin"
              }
            }
          },
          "Type": "Component",
          "Y": 256
        },
        {
          "X": 256,
          "Name": "ClockGenerator1",
          "Instance": {
            "Frequency": 10,
            "OutputPin": {
              "SinkPins": [
                {
                  "ID": "__OpenWireRootUnit__.Counter1.InputPin"
                }
              ]
            },
            "+": "TArduinoClockGenerator"
          },
          "Type": "Component",
          "Y": 256
        },
        {
          "X": 336,
          "Name": "RandomRGBWColor1",
          "Instance": {
            "ClockInputPin": {
              "SourcePins": [
                {
                  "ID": "__OpenWireRootUnit__.CompareValue1.OutputPin"
                }
              ]
            },
            "OutputPin": {
              "SinkPins": [
                {
                  "Name": "__OpenWireRootUnit__.NeoPixels1.PixelGroups.Color Pixel1.ColorInputPin",
                  "ID": "__OpenWireRootUnit__.NeoPixels1.PixelGroups._Item0.ColorInputPin"
                }
              ]
            },
            "+": "TArduinoRandomRGBWColor"
          },
          "Type": "Component",
          "Y": 496
        },
        {
          "X": 720,
          "Name": "NeoPixels1",
          "Instance": {
            "PixelGroups": {
              "*": [
                {
                  "Name": "Color Pixel1",
                  "IndexInputPin": {
                    "SourcePin": {
                      "ID": "__OpenWireRootUnit__.Counter1.OutputPin"
                    }
                  },
                  "+": "TArduinoNeoPixelsColorPixelGroup",
                  "ColorInputPin": {
                    "SourcePin": {
                      "ID": "__OpenWireRootUnit__.RandomRGBWColor1.OutputPin"
                    }
                  },
                  "CountPixels": 12
                }
              ]
            },
            "OutputPin": {
              "SinkPins": [
                {
                  "Name": "__OpenWireRootUnit__.Arduino.Digital.Digital[ 6 ].DigitalInputPin",
                  "ID": "__OpenWireRootUnit__.Arduino.Digital._Item6.DigitalInputPin"
                }
              ]
            },
            "+": "TArduinoNeoPixels",
            "Brightness": 0.999755859375
          },
          "Type": "Component",
          "Y": 480
        }
      ],
      "Type": "Diagram",
      "Selection": [
        "NeoPixels1"
      ]
    }
  ],
  "Content": "OpenWire Diagram"
}

Credits

ronfrtek
307 projects • 77 followers
Arduino Fan!

Comments