Please help with Logic- I won't ask after this = Honest

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by mikegriff, Jul 3, 2005.

  1. mikegriff

    mikegriff

    Joined:
    Aug 3, 2004
    Messages:
    153
    Likes Received:
    3
    Location:
    Wales
    {Mike in from Comfort}
    once (GetLightingLevel("Mike") = 64) and
    (GetLightingLevel("DownStairs Counter") = 0%) then
    begin
    SetTriggerLevel("Downstairs", 100%);
    LightLevel := PercentToLevel(GetLightingLevel("DownStairs Counter")) ;
    LightLevel := LightLevel + 1;
    SetLightingLevel("DownStairs Counter", LevelToPercent(LightLevel), "0s");
    end;

    I'm trying to increment a lighting level by 1
    I need to do this so that my comfort system counters can be updated

    all I get is this error
    Error C1025 at line 32:65 - Error in type of standard function parameter


    I have read the help file HONEST but I cant seem to find a way of putting a variable into a level :(

    Also the fact that Logic keeps reporting levels in percentage

    I would really like to use all 255 levels
    and I seem to rememnber that percentage by its very nature rounds up or down some of the 255 levels

    Help please - once cured I should be able to sort out the rest
    thanks in advance
    Mike
     
    mikegriff, Jul 3, 2005
    #1
  2. mikegriff

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    The GetLightingLevel returns a level from 0 to 255, not a %, hence you do not need the PercentToLevel function.
    The SetLightingLevel takes a level as 0 to 255, not percent, so you do not need the LevelToPercent.[/QUOTE]
    You will need to tell us exectly where in your code this is.
     
    Darren, Jul 4, 2005
    #2
  3. mikegriff

    mikegriff

    Joined:
    Aug 3, 2004
    Messages:
    153
    Likes Received:
    3
    Location:
    Wales
    I've taken out the % stuff, as it was showing in % added it in case that was causing the error

    Found my mistake after sorrecting this
    I was declaring
    LightLevel, Threshold : real;
    instead of
    LightLevel, Threshold : integer;

    Thanks for your help
    Mike
     
    Last edited by a moderator: Jul 4, 2005
    mikegriff, Jul 4, 2005
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.