Adding a Button widget

These steps will show you how to add a Button widget to your project, which is a controller widget that can be used to turn an LED on and off.

The working area of the app builder is referred to as a canvas and has a dotted background with horizontal and vertical guides that allow you to easily arrange and align different types of widgets:

Canvas
  1. Tap anywhere on the canvas or the plus icon on the toolbar to get the Widget Box. The Widget Box lists all the widgets available under different categories to build the application.
  2. On the Widget Box, tap Button under CONTROLLERS:
Button widget under CONTROLLERS
  1. A Button widget will be added onto the canvas:
Button widget
  1. Tap the Button widget to open the Button Settings page.
  2. Tap PIN under OUTPUT and choose Digital followed by GP18 PWM from the list (this is the physical Pin 10/BCM Pin 18/GPIO Pin 18 in the GPIO header of the Raspberry Pi 3 connected to the LED).Then, tap the OK button.
  1. Under MODE, slide the switch to the SWITCH position. This will configure the button as a switch:
Configure the button as a switch
  1. Tap the left arrow on the toolbar. Now, your configured Button widget should look as shown:
Button widget connected to gp18 (BCM 18)
  1. Long tap and release the Button widget. You will see two points on the border of the Button widget:
Button widget with resizing points
  1. Use these points to resize the Button widget by tapping and dragging on horizontal pane.
  2. After resizing, tap on the canvas area to confirm the new dimension. Now your button should look as shown here:
Resized button
  1. Long tap the Button widget until you see the move icon on the Now toolbar, and without releasing your finger, drag the button to a new location on the canvas:
Moving Button widget
  1. The following screenshot shows the button moved to approximately the center of the canvas:
Button placed in about the center of the canvas
  1. Now tap on the canvas to confirm the new location for the button:
Button moved to a new location

Now you have built the Blynk app using the Blynk app builder to control an LED connected to the Raspberry Pi.

..................Content has been hidden....................

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