Using Controls¶
How Controls Work¶
When you use a control button/slider/picker etc. the resulting value of the control and the control identifier is sent over bluetooth to the connected Raspberry Pi/Linux system.
The ActionController Python Code on the RAspberry Pi detects the control identifier and the associated value, and a handler (which you have written) can take action.
Example:
You defined a slider with code
Slider1, with minimum value of 0 and max of 99. When you move the slider in the app on the iPhone, the message containing bothSlider1and the value (for example = 50) is sent to the Raspberry Pi.On the RPi, you have defined a handler that for this control code
Slider1- which expects a number. It receives the value 50. You might then launch a python function tht adjust the volume of a player to 50, or dims the intensity of a light (via GPIO) to 50%.
Control Code: unique identifier¶
The control's identifier is called the control code in the app. You set it when you create or edit a control.
The Code (identifier) must be unique - this is enforced by the app.
The app will always suggest a unique identifier containing the name of the type of control you are creating.
It is recommended to let the app choose the Code.
Note: the
Settingstab displays a lost of all your controls, and the control Code is displayed on the top line, in the center of each control.
Important: You must set up the ActionController Python Code to handler each control Code defined in your app
Controls That Send Data¶
These controls send values to the Raspberry Pi or Linux system when the user operates them:
- Button
- Text Input
- Slider*
- Stepper*
- Picker* (select among pre-defined options)
- On/Off Button* (toggle)
- Date Picker*
- Color Picker*
*: starred controls can be initialized. The Raspberry Pi can send them an initial value, and the control will be adjusted to that value on the iPhone/iPad control tab.
Controls That Display Data¶
These controls display information received from the Raspberry Pi or Linux system:
- Text Display
- Gauge
These controls accepts data from the Raspberry Pi - but do not send any to it.
Bluetooth Connection¶
You can create/edit controls without being connected to a Raspberry Pi over bluetooth.
Controls will operate normally (controls Tab) - but no data will be sent to, or received from a Raspberry Pi until you have established a bluetooth connection.
To connect:
- Open the
Controlstab. - Tap
Select Deviceor the blue antenna icon. - Choose the target system from the list.
- Wait for the connection to complete.
The name of the connected device (RPi) is displayed at the top of the controls screen.
To disconnect:
- Stay on the
Controlstab. - Tap the disconnect icon shown beside the connected device name.
For full connection details, see Connecting to a Raspberry Pi.