MATLAB Examples

setLedsAllB

Set the colour and brightness of all 16 LEDs on Engduino

Contents

Syntax

e.setLedsAllB(colour,brightness);

Description

e.setLedsAllB(colour,brightness) First parameter sets the colour and the second parameter sets brightness level of all the 16 LEDs

Examples

  • Set the colour and brightness of the 16 LEDs
  • Connect to Engduino on port 3 and set the colours and brightness of the 16 LEDs

    % Colours are defined in engduino object as:
    %     COLOR_RED =     0
    %     COLOR_GREEN =   1
    %     COLOR_BLUE =    2
    %     COLOR_YELLOW =  3
    %     COLOR_MAGENTA = 4
    %     COLOR_CYA =     5
    %     COLOR_WHITE =   6
    %     COLOR_OFF =     7
    % Brightness level from 0-15
    
    % Check if the Engduino object already exists. Otherwise initialize it.
    if (~exist('e', 'var'))
            e = engduino();
    end
    e.setLedsAllB(e.COLOR_RED,1);
    

    Input Arguments

    colour Can be an integer value of 0-7 or use the colour properties in Engduino object
    brightness The brightness level of LED in the range [0-15]

    Output Arguments

    res Return status to indicate whether function has been executed (int) 0: OK, <0: Error code

    Properties