Use Dashboard Widgets With Magicbit [Magicblocks]

by magicbit in Circuits > Electronics

167 Views, 0 Favorites, 0 Comments

Use Dashboard Widgets With Magicbit [Magicblocks]

Use Dashboard Widgets with Magicbit [Magicblocks]

This tutorial will teach you to use Magicblocks Dashboard Widgets with your Magicbit. We are using magicbit as the development board in this project which is based on ESP32. Therefore any ESP32 development board can be used in this project.

Supplies

  • Magicbit - Pro

​Story

Hello and Welcome, This short tutorial will teach you to use Dashboard Widgets with Magicbit using Magicblocks.

First of all log into to your Magicblocks account,

Magicblocks is an easy visual programming software for program your magicbit. Anyone can program their micro controller by using magicblocks.io and there is no need of programming knowledge. You can sign up for free.

Start and Open the Playground.

Next make sure your Magicbit is connected to the internet and plugged-in and also linked to your account through Device Manager.

All Done? then scroll down to Step 1.

List of Items Required

Magicbit: Magicbit Is an integrated development platform based on ESP32 for learning, prototyping, coding, electronics, robotics, IoT and solution designing.

Setting Up the Analog in Block

screenshot_(139)_jj6JebTRby.jpg
screenshot_(140)_rjSqfWopg3.jpg
screenshot_(91)_emb8INz9SQ.jpg
screenshot_(141)_SuBxKoIpqv.jpg

1. Drag & drop the Analog In block from the input nodes section on the left of the screen to the Flow.

2. Double-click on the Analog In block and type or paste your unique Device id from the Device Manager Tab on your Magicblocks account. [ This will link the digital in with the Magicbit ]

3. Choose POT(39) from the PIN drop-down menu.(Connects with the Potentiometer on your Magicbit)

4. Select the Method as Interrupt from the drop-down menu.

Setup the Dashboard Widgets

screenshot_(142)_aVSxsEFkcW.jpg
screenshot_(148)_E1tSkhfQSo.jpg
screenshot_(149)_iLPIkuwsb0.jpg
screenshot_(150)_tmla8XXVxV.jpg
screenshot_(152)_r4bj4Zxnyc.jpg
screenshot_(153)_fJPtKdsxJ0.jpg

1. Drag & Drop the Text, Guage, Chart, Audio Out, Notification blocks from the Dashboard section on the left of the screen to the Flow.

2. Text Block

  • Rename the Text Field[Optional].

3. Guage Block

  • Rename the Label[Optional].
  • Change the Range of the Guage to 0 - 4095.

4. Chart Block

  • Rename the Label[Optional].
  • Change the Chart Max & Min to 0 - 4095.
  • Change the scale of X-axis to 2 minutes[Optional].

5. Audio Out Block

  • Set the TTS(Text-To-Speech) Voice from the drop-down menu.
  • Tick the 'Play audio when window not in focus' check box.

6. Notification Block

  • Set where in the screen you need the notification to pop up.

Setup the Change Block

screenshot_(144)_T5MvBrUzJA.jpg
screenshot_(145)_IJpju4aWh8.jpg
screenshot_(146)_WXIrDgzo8M.jpg
screenshot_(147)_djwLgmIrPs.jpg
Capture.JPG
Capture1.JPG
screenshot__34__LgAo8klYI3.jpg
screenshot__35__x1BhIXZnSM.jpg
screenshot__37__sCxZ7X5jV4.jpg

(This Node is used to change the 0 & 4095 signal input from the Analog In node to any text to use audio out Text-To-Speech feature.)

1. Drag & Drop the Change Block from the function nodes section on the left of the screen to the flow.

2. Add new rule from the '+' Button to use 2 rules.

3. Change the function of both of the rules from Set to Change from the drop-down menu.

4. Next change the 'Search for' function from String(text) to Number in both of the rules. And make sure the 'Replace with' function is set to String(text).

5. Set up the rules.

  • The First Rule to search for '4095' in signal input and replace it with our text (e.g. 'Maximum' )
  • The Second Rule to search for '0' in signal input and replace it with our text (e.g. 'Minimum')

[Optional] Import Already Setup Nodes

If you had trouble setting up nodes, you can use the import feature in Magicblocks to get the nodes which has been already setup.

  • First copy this code to your clipboard.
  • Click on the options menu on the top right-hand corner of the screen.

  • Next hover your cursor over the Import sub-menu.

  • Then click on Clipboard and paste the code on your clipboard to the text field.

  • Select current flow or new flow and click on Import.

IMPORTANT

Make sure you type your device id on both of the Digital In node properties.

Finally Deploying the Blocks

screenshot_(88)_o65645S9to (1).jpg
screenshot_(89)_qsXqYHDwdI.jpg
pot_red_border_sQUpH96ExO.jpg
screenshot_(155)_Zb0cd6heKa.jpg
screenshot_(135)_M5QBmmsowJ.jpg

  • Make sure all the blocks are connected.
  • Click on Deploy button on the top right-hand corner of the screen.
  • After deploying go to the dashboard ui by clicking the link to dashboard URL on the top right-hand corner of the screen.
  • Rotate the Potentiometer on your Magicbit and the dashboard widgets will interact accordingly.

  • Widget Layout Information (below).

NOTE - Audio Out block's Text-To-Speech feature will be heard through your system audio.

Troubleshooting

  • Check whether your Magicbit is connected to the internet.
  • Check whether the correct PIN is used (e.g. 'POT(39)').