Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Connect a reed switch to drive pin DP2 high/low

  • What circuit do you use?

  • Modify the flow from¬†Lab 40. Dashboard: LED to interact with URL "/digital_out/D4" rather than "/digital_out/INDICATOR_0"

  • Make sure you can switch the buzzer on/off from your phone
    Info
    iconfalse
    titleAnswer 1:



  • Create the following Node-RED flow to enable digital input pin DP2
    Image Added

    Tip
    titleA little help

    The function node contains the following code:

    Code Block
    msg.payload            = {
        "method" :  "PUT",
        "url" :     "/digital_in/D0", // D0==DP2
        "body":     {
            "enable":      msg.payload,
            "rate":        10000,
            "sampleCount": 1,
            "dataFormat":  1
        },
        "token":    "myToken",
    }
    return msg;



  • Add the necessary nodes to create the following dashboard:
    Image Added 

Tip
iconfalse
titleExtra points!

Create a Node-RED dashboard on which you can control both the LED and the buzzerAdd a "notification" dashboard node which appears when the state toggles.