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 valueint r = param[0].asInt();// get a GREEN channel valueint g = param[1].asInt();// get a BLUE channel valueint 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 ...

Get Hands-On Internet of Things with Blynk now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.