Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Magicbit
Published

BIPES with Magicbit (Block based Integrated Platform)

In this tutorial, we are going to introduce how to program magicbit with BIPES block-based platform.

BeginnerProtip1 hour435
BIPES with Magicbit (Block based Integrated Platform)

Things used in this project

Hardware components

Magicbit
×1

Software apps and online services

BIPES(Python Block Programming)

Story

Read more

Code

Temperatuer and Humidity Sensor (DHT11)

XML
<xml xmlns="https://bipes.net.br">
  <workspace>
    <field name="DEVICE">ESP32</field>
    <field name="TIMESTAMP">1630555350975</field>
  </workspace>
  <block type="dht_init" id="L!OCN0J1V^o*|hw,4yf$" x="288" y="87">
    <field name="DHT_TYPE">DHT11</field>
    <field name="DHT_PIN_MSG">pin</field>
    <value name="pin">
      <shadow type="pinout" id="vrn~nv+*_iAZ{xY4=H6@">
        <field name="DEVICE">ESP32</field>
        <field name="PIN">2</field>
      </shadow>
      <block type="math_number" id="bmxaoxf6d[G#;M8Dw.{-">
        <field name="NUM">32</field>
      </block>
    </value>
    <next>
      <block type="dht_measure" id="+vjN@*_y3$(dV$N2=_:{">
        <field name="MSG_MEASURE_DHT">Measure DHT11/22 Sensor</field>
        <next>
          <block type="timer" id="!/0U[KWe)pwahM9$P+fI">
            <field name="timerNumber">1</field>
            <field name="MODE">PERIODIC</field>
            <field name="interval">1000</field>
            <statement name="statements">
              <block type="text_print" id=".ieoQWC6l0he!)DNYWi]">
                <value name="TEXT">
                  <shadow type="text" id="#*G@EfJ3*tuMv%~i;_Ql">
                    <field name="TEXT">abc</field>
                  </shadow>
                  <block type="text_join" id="67cQS.vt~*x.3QB@Bn~A">
                    <mutation items="2"></mutation>
                    <value name="ADD0">
                      <block type="text" id="fA1tmn/u.UjY(ygf:dAx">
                        <field name="TEXT">Temperature: </field>
                      </block>
                    </value>
                    <value name="ADD1">
                      <block type="dht_read_temp" id="SoSrxLOKlUUZ|LSFECkA">
                        <field name="MSG_READ_DHT_TEMP">Read DHT11/22 Temperature</field>
                      </block>
                    </value>
                  </block>
                </value>
                <next>
                  <block type="utime.delay" id="u3b]q0B*`Tuf.C)CANa*">
                    <field name="SCALE">sleep</field>
                    <value name="TIME">
                      <shadow type="math_number" id="~B!$}/qpI07(-9rck_O;">
                        <field name="NUM">1</field>
                      </shadow>
                    </value>
                    <next>
                      <block type="text_print" id="y/.M$wMoE=4KaJGz[]Or">
                        <value name="TEXT">
                          <shadow type="text">
                            <field name="TEXT">abc</field>
                          </shadow>
                          <block type="text_join" id="fA#bG}zZ/1eVxiWL]GtE">
                            <mutation items="2"></mutation>
                            <value name="ADD0">
                              <block type="text" id="t~[d}U+@1V:Y$MWC@pbb">
                                <field name="TEXT">Humidity: </field>
                              </block>
                            </value>
                            <value name="ADD1">
                              <block type="dht_read_humidity" id="q~hzh:30-z}=STE3)Me*">
                                <field name="MSG_READ_DHT_HUMI">Read DHT11/22 Humidity</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <next>
                          <block type="utime.delay" id="7N+_C!h$nL%cPTbEBHN5">
                            <field name="SCALE">sleep</field>
                            <value name="TIME">
                              <shadow type="math_number" id="DjTT`CO@~`(sp~;.7Gt%">
                                <field name="NUM">1</field>
                              </shadow>
                            </value>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </statement>
          </block>
        </next>
      </block>
    </next>
  </block>
</xml>

Credits

Magicbit

Magicbit

57 projects • 34 followers
Magicbit is an integrated development platform based on ESP32 for learning, prototyping, coding, electronics, robotics, IoT and more.

Comments