====== Velleman K8055 ====== This article describes remote control for the Velleman K8055 family of USB experiment boards. ===== Supported Hardware ===== Supported Velleman products are: * [[https://www.velleman.eu/products/view/?id=461858|WSI8055N]] (kit for self-assembly) * [[https://www.velleman.eu/products/view/?id=460494|WPI110N]] (assembled device) as well as their (now obsolete) predecessors * [[https://www.velleman.eu/products/view/?id=404880|K8055N]] * [[https://www.velleman.eu/products/view/?id=351346|K8055]] * [[https://www.velleman.eu/products/view/?id=404998|VM110N]] * [[https://www.velleman.eu/products/view/?id=351980|VM110]] (To keep the editing effort as low as possible, all these units are referred to as //K8055// throughout the software and this documentation.) mAirList supports the five digital inputs for triggering of [[reference:remote_control_commands|remote commands]] directly. The digital as well as the analogue outputs can be used via scripting. ---- ===== Configuration ===== === Digital Inputs === Open the standalone config app, or the Control Panel, go to the //Remote Control// section, and add a new //Vellemann K8055(N)// remote. The configuration dialog will look like this: {{ :config:remotecontrol:pasted:20160829-222415.png?400 }} First, you can set up the **device address** (corresponds to the jumpers on the board) and the **update interval** for polling. Then you can assign a [[reference:remote_control_commands|command]] for each input 1-5, and for the event that the pin goes ON or OFF, respectively. ---- ===== Scripting ===== === Digital Outputs === To access a K8055 remote from a script, use the following function: function K8055Remote(iIndex: integer): IK8055Remote; ''iIndex'' is the number of the K8055 remote set up in the system, with ''0'' being the first (and often only) one („zero-based“). The function will return a reference to a ''IK8055Remote'' interface, which provides amongst others the following methods: procedure SetDigitalChannel(Channel: integer); procedure ClearDigitalChannel(Channel: integer); procedure ClearAllDigital; ''Channel'' refers to the digital channels, where ''1'' is the first one („one-based“). A complete call for switching on (setting) digital channel 3 on the first Velleman unit then should look like this: K8055Remote(0).SetDigitalChannel(3); === Digital Inputs === The status of the digital inputs can be read by the fucntions function ReadDigitalChannel(Channel: integer): boolean; function ReadAllDigital: integer; The former reads the status for each input individually, e. g. for channel 2: K8055Remote(0).ReadDigitalChannel(2); whereas the latter gives a complete survey of all five inputs via the five least significant bits. Example: A value of 25 corresponds to inputs 1, 4 and 5 being set („on“) and inputs 2 and 3 being cleared „off“). 1 ⋅ 2⁰ + 0 ⋅ 2¹ + 0 ⋅ 2² + 1 ⋅ 2³ + 1 ⋅ 2⁴ = 1 + 0 + 0 + 8 + 16 = 25 ^ ^ ^ ^ ^ Bit 1 | Bit 3 | Bit 5 Inp 1 Bit 2 Inp 3 Bit 4 Inp 5 Inp 2 Inp 4 === Analogue Outputs === The analogue outputs can be actuated with the following method: procedure OutputAnalogChannel(Channel, Value: integer); … where ''Channel'' resembles the number of the analogue output (i. e. ''1'' or ''2'') and ''Value'' is an integer value between ''0'' and ''255'': * ''0'' leads to a voltage of 0V at the analogue or a duty factor of 0% at the PWM output, respectively. * ''255'' leads to a voltage of 5V at the analogue or a duty factor of 100% at the PWM output. * The effect of values lying in between these extremes can be characterised by: * '' / 255 * 5V'' or * '' / 255 * 100%'', respectively. Notably the PWM output can be taken advantage of driving an ON-AIR lamp directly, as long as it meets the voltage and current limits of the transistor used in the circuit (BC337 that is, as of fall 2019).