MATLAB Examples

setLedsAll

Set one colour for all the 16 LEDs on Engduino

Contents

Syntax

e.setLedsAll(colour);

Description

e.setLedsAll(colour) Function takes one LED colour as input, set one colour for all the 16 LEDs on Engduino

Examples

  • Set the colour of the LEDs
  • Connect to Engduino on port 3 and set the Colour of all the LEDs to red

    % 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
    
    % Check if the Engduino object already exists. Otherwise initialize it.
    if (~exist('e', 'var'))
            e = engduino();
    end
    e.setLedsAll(e.COLOR_GREEN);
    

    Input Arguments

    colour Can be an integer value of 0-7 or use the colour properties in Engduino object

    Output Arguments

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

    Properties