Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Internet of Things with Blynk

You're reading from   Hands-On Internet of Things with Blynk Build on the power of Blynk to configure smart devices and build exciting IoT projects

Arrow left icon
Product type Paperback
Published in May 2018
Publisher Packt
ISBN-13 9781788995061
Length 271 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Pradeeka Seneviratne Pradeeka Seneviratne
Author Profile Icon Pradeeka Seneviratne
Pradeeka Seneviratne
Arrow right icon
View More author details
Toc

Using virtual pins

Now you know how to write the current state of the Button widget to a GPIO pin.

With virtual pins, you can send or receive any type of data between the microcontroller (Raspberry Pi) and the Blynk app. The Blynk app builder provides 128 virtual pins for working with Raspberry Pi. They allow you to interface with sensors, actuators, and libraries. These pins have no physical properties. Some Blynk widgets support virtual pins, some do not.

As an example, you can write the current state of the Button widget to the virtual pin V1 as shown here. Then, you can assign the incoming value from the virtual pin to a variable for further processing:

BLYNK_WRITE(V1)

{

intpinValue = param.asInt(); // assigning value on Virtual Pin (V1) to a variable

// process received value

}
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime