Pin State Monitor Module

Pin State Monitor Digital

This module allows you to remotely monitor the live status of devices and debug them by displaying the values of all the pins – both digital and analog. It has the following two display screens:

  1. Analog: This shows the values of the analog pins between 0 and 1023.
  2. Digital: This displays the states of the digital pins. These pins can either be at 1 or at 0.

You can switch between the two screens by sliding right or left.

 

You can now access this module on iOS devices by downloading Dabble from App Store.

Introduction

The Pin State Monitor module is one of the most useful modules to debug your sensors and calibrate them for your program.  This module provides you the real-time status of all the digital and analog pins.

Digital Pins Monitor

This shows the values of all the digital pins states. The state is shown in the form of ON or OFF, where ON state means the state of the pin is HIGH (5V) and OFF state means the state of the pin is LOW (0V).

Dabble Pin State Monitor Digital

Analog Pins Monitor

This shows the analog value of the voltage on the analog input pins. The value is shown from 0 to 1023, which is mapped to the voltage from 0 to 5V. 

For example, is the value showing on the monitor is 512, then the voltage value will be approximately 5*(512/1023) = 2.5V.

Dabble Pin State Monitor Analog

Arduino IDE Functions

Header

To include the Pin Monitor module in the Arduino program, you have to include the following header:

#define CUSTOM_SETTINGS

#define INCLUDE_PINMONITOR_MODULE

After defining the above mention headers, you have to include the dabble library:

#include <Dabble.h>

You can download the zip of Dabble-Arduino (for evive, Uno, Mega, and Nano) or Dabble-ESP32 depending board you are using.

Enabling Bluetooth Communication

For evive and Arduino Mega, Uno and Nano

Dabble.begin(Baud_Rate);

Here Baud_Rate is the baud rate set for the Bluetooth module. With evive, you normally get 115200 baud rate modules. 

For ESP32

Dabble.begin("Bluetooth_Name");

In place of Bluetooth_Name  enter name that you want to keep for Bluetooth of ESP32. Default name given in the library is “MyEsp32”. 

Refreshing the data

To refresh the data that the device has got from the mobile app, you have to use the following line of code:

Dabble.processInput();

Functions

If you want to refresh the pin state in your app, you have to use the following functions to do it:

  1. PinState.sendDigitalData() : This function sends all the digital pin state to the app.
  2. PinState.sendAnalogData() : This functions sends all the analog pin state to the app.

You have to add a delay between sending data to the app. This delay should be greater than 20 microseconds to achieve smooth functionality of the module.

PictoBlox (Scratch) Blocks

There is a stacked block named as “ enable pin state monitor” and its function is to enable the Pin State Monitor feature of Dabble.

enable pin state monitor

evive Notes Icon
Note: When you are using this module with Arduino Uno, Mega, and Nano,  you have to set the Bluetooth baud rate to the baud rate of the Bluetooth module to have proper communication between the board and the module. To set the baud rate you have to use set bluetooth baud rate to () block.

set bluetooth baud rate to

Examples

Click here to view Arduino IDE Example for Pin State Monitor Module

In order to send the status of digital and analog pins of your board copy code as per your board from below mentioned board-wise codes or navigate to “Files>>Examples>>Dabble>>”  and open “PinStateMonitor” for your board.

evive

Mega

Uno and NanoESP32

Click here to view PictoBlox (Scratch) Example for Pin State Monitor Module

To enable the Pin State Monitor feature for the very first time, you have to upload the following script in upload mode:

enable pin state monitor example

The above script only works with evive, for working with Mega, Uno or Nano replace head block “when evive starts up” with start up block corresponding to your board and also start add set baud rate block. Pictoblox currently does not support ESP32; however, it will be added soon.

An example scripts for Uno is shown below:Example_PinstateMonitor

Leave a Reply

Close Menu
×

Cart