Control computer and phone

Via the app, your electronic device can control your phone or computer respectively.
Conversely, the device can be controlled by some more specific properties of the mobile or desktop client, like for example the phone's accelerometer.

Let's do an example! We'll create a device for controlling your computer's volume with a potentiometer.

  • Start by creating a new project and adding an Analog knob peripheral. The analog knob is a peripheral, which actually represents a potentiometer and it has one value, which ranges between 0.0 and 1.0, depending on how the potentiometer's turned
  • Then add the Volume peripheral. The volume peripheral represents the volume of the on which the app is running. It has one value, which ranges between 0.0 and 1.0, where at 0.0 the volume is muted and at 1.0 the volume is at full
  • Now we just need to link the value of the Volume to the value of the analog knob
    We'll do this by using a very simple script. In the script box, write
                        Volume.volume = AKnob.value;
                    
    This assigns the value of the knob to the value of the volume, so this way the volume amount will be proportional to how far the potentiometer is turned.
And that is it!
You can now start the app, connect to the device and try it out!

For more information about the scripting, check out the Logicode info page.