anchor.diff:      {ok, I2cRef} ->
         
         % Reset the LCD, get its attention
  -      write_command_high(I2cRef, 16#30),
  +      write_command_high(I2cRef, ?BACKLIGHT_OFF, 16#30),
         block_utils:sleep(5),
  -      write_command_high(I2cRef, 16#30),
  +
  +      write_command_high(I2cRef, ?BACKLIGHT_OFF, 16#30),
         block_utils:sleep(1),
  -      write_command_high(I2cRef, 16#30),
  +
  +      write_command_high(I2cRef, ?BACKLIGHT_OFF, 16#30),
         block_utils:sleep(1),
  -      write_command_high(I2cRef, ?FUNCTION_SET),
  +
  +      write_command_high(I2cRef, ?BACKLIGHT_OFF, ?FUNCTION_SET),
         block_utils:sleep(1),
  +
         % The LCD display should be reset and in 4 bit mode now
         % From this point use normal command and write data functions
   
         % Set Num of lines, Font, and keep Data Length 4 bits
  -      function_set(I2cRef, (?NUM_LINES_2)),
  +      function_set(I2cRef, ?BACKLIGHT_OFF, (?NUM_LINES_2)),
   
         % Turn the display off
  -      display_control(I2cRef, ?NO_PARAMS),
  +      display_control(I2cRef, ?BACKLIGHT_OFF, ?NO_PARAMS),
   
          % Clear the screen
  -      clear(I2cRef),
  -
  -      entry_mode_set(I2cRef, (?INCREMENT)),
  +      clear(I2cRef, ?BACKLIGHT_OFF),
  +
  +      entry_mode_set(I2cRef, ?BACKLIGHT_OFF, (?INCREMENT)),
   
         {ok, I2cRef};
         
  
positive.code: 	    
    case init_lcd_driver(I2cDevice, I2cAddr) of
      {ok, I2cRef} ->
        Status = initialed,
        Value = 0, 
        {ok, Private2} = attrib_utils:set_value(Private1, i2c_ref, I2cRef);
  
negative.code:   end.
  
  
  %%
  %% Read control inputs and update the LCD control
  %%
  update_lcd_control(I2cRef, Inputs) ->
  
    case input_utils:get_boolean(Inputs, display) of
      {ok, true} -> Display = ?DISPLAY_ON;
              _  -> Display = ?DISPLAY_OFF
    end,
  
    case input_utils:get_boolean(Inputs, cursor) of
      {ok, true} -> Cursor = ?CURSOR_ON;
              _  -> Cursor = ?CURSOR_OFF
    end,
  
    case input_utils:get_boolean(Inputs, blink_cursor) of
      {ok, true} -> BlinkCursor = ?BLINK_CURSOR_ON;
              _  -> BlinkCursor = ?BLINK_CURSOR_OFF
    end,
   
    case input_utils:get_boolean(Inputs, backlight) of
      {ok, true} -> Backlight = ?BACKLIGHT_ON;
              _  -> Backlight = ?BACKLIGHT_OFF
    end,
  
    display_control(I2cRef, Backlight, ((Display bor Cursor) bor BlinkCursor)).
  
  
  
  clear(I2cRef, Backlight) ->
    write_command(I2cRef, Backlight, ?CLEAR_DISPLAY, ?NO_PARAMS).
  
  
  return_home(I2cRef, Backlight) ->
    write_command(I2cRef, Backlight, ?RETURN_HOME, ?NO_PARAMS).
  
  
  function_set(I2cRef, Backlight, Params) ->
    write_command(I2cRef, Backlight, ?FUNCTION_SET, Params).
  
  
  display_control(I2cRef, Backlight, Params) ->
    write_command(I2cRef, Backlight, ?DISPLAY_CONTROL, Params).
  
  
  entry_mode_set(I2cRef, Backlight, Params) ->
    write_command(I2cRef, Backlight, ?ENTRY_MODE_SET, Params).
  
  
  write_command(I2cRef, Backlight, Command, Params) ->
    CmdAndParams = (Command bor Params),
    % Always operate in 4 bit mode when using an I2C interface
    % Write high nibble (bits 7-4) first, then low nibble (bits 3-0)
    write_command_high(I2cRef, Backlight, CmdAndParams),
    write_command_low(I2cRef, Backlight, CmdAndParams).
  
  
  % write high half of command byte value, R/W = 0, RS = 0
  write_command_high(I2cRef, Backlight, Value) ->
    HighValue = ((Value band 16#F0) bor Backlight),
    write_value(I2cRef, HighValue).
  
  
  % write low half of command byte value, R/W = 0, RS = 0
  write_command_low(I2cRef, Backlight, Value) ->
    LowValue = ((Value bsl 4) bor Backlight),
    write_value(I2cRef, LowValue).
  
  
  write_data(I2cRef, Backlight, Data) ->
    % Always operate in 4 bit mode when using an I2C interface
    % Write high nibble (bits 7-4) first, then low nibble (bits 3-0)
    write_data_high(I2cRef, Backlight, Data),
    write_data_low(I2cRef, Backlight, Data).
  
  
  % write high half of data byte value, R/W = 0, RS = 1
  write_data_high(I2cRef, Backlight, Value) ->
    HighValue = (((Value band 16#F0) bor Backlight) bor ?RS_DATA),
    write_value(I2cRef, HighValue).
  
  
  % write low half of data byte value, R/W = 0, RS = 1
  write_data_low(I2cRef, Backlight, Value) ->
    LowValue = (((Value bsl 4) bor Backlight) bor ?RS_DATA),
    write_value(I2cRef, LowValue).
  
  
  