fbpx
NeoPixel led control
MagicBlocks Project

NeoPixel led control

Introduction

Hello and Welcome, This short tutorial will teach you to use the RGB LED with Magicbit using Magicblocks.

Magicblocks is easy visual programming software to program your Magicbit. Anyone can program their microcontroller by using magicblocks.io  and there is no need for programming knowledge. You can sign up for free.

Start and Open the Playground.

Insert Neopixel block

  • Drag & drop the Neopixel block from the Magicbit section on the left of the screen to the Flow.
  • Double-click on the Neopixel block and change the device id and pin.

Insert inject block

  • Drag & drop the inject block from the input nodes section on the left of the screen to the Flow.
  • Double-click on the inject block and change the payload as a JSON.

Neopixel block allows R,G, B color values as JSON payload. so we need to code that. it can change from 0 to 255 value.

[[ Red_value, Green_value, Blue_value]]

we can make RED color changing red value 255 and others set to o. [[255,0,0]]

insert another inject block and make it green color following the above steps.

we can make Green color changing green_value 255 and others set to o. [[0,255,0]]

again insert another inject block and make it Blue color following the above steps.

we can make Blue color changing Blue_value 255 and others set to o. [[0,0,255]]

Deploy program

• Click on the Deploy button on the top right-hand corner of the screen.

now click the nodes and see the color changing of RGB LED.

Related Posts
Leave a Reply