Using virtual pins

In merge mode, the zeRGBa widget writes a single message to the virtual pin, which consists of an array of values. As an example, if you have a zeRGBa widget connected to the virtual pin V1, you can parse each value for RGB on your Raspberry Pi as:

BLYNK_WRITE(V1) // zeRGBa assigned to V1

{

// get a RED channel value

int r = param[0].asInt();

// get a GREEN channel value

int g = param[1].asInt();

// get a BLUE channel value

int b = param[2].asInt();

}

The following steps explain how to add a zeRGBa widget to the canvas and configure it for use with virtual pins:

  1. In edit mode, tap the plus icon to open the Widget Box.
  2. Under Controllers, tap zeRGBa. A zeRGBa widget will be added to the canvas:
zeRGBa widget
  1. Tap the zeRGBa widget to open zeRGBa Settings:
zeRGBa Settings page
  1. Switch the toggle button under OUTPUT to the MERGE position:
zeRGBa widget in merge mode
  1. Tap PIN, and from the drop-down list choose Virtual, followed by V1. Then, tap OK.
  2. The zeRGBa Settings page should look like this:
Settings for use with Virtual pins
  1. Keep the other options on the settings page as they are. Tap the back arrow icon to go to the canvas. Now, your zeRGBa widget should look like this:
zeRGBa widget connected to the virtual pin V1
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.248.208