logo elektroda
logo elektroda
X
logo elektroda

Creating Variables and Utilizing Channels in OpenBeken: A How-To Guide

max_mcu 444 1
ADVERTISEMENT
  • #1 20942231
    max_mcu
    Level 3  

    How can I create variable e.g.

    Dim intX As Integer

    I found no information on how to create variables and how to freely use only the CHxx, no idea what the CHxx is.. int, long, string?

    CHxx = CHxx + 1 doesn't work
  • ADVERTISEMENT
  • #2 20990110
    p.kaczmarek2
    Moderator Smart Home
    Currently we're using channels as variables. They are floating point numbers.

    So, to set a channel, you can do:
    
    setChannel 1 123
    

    Then you can, for example, use channel value in math expression like:
    
    setChannel 2 $CH1*10
    

    See a list of expressions:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/constants.md

    You can also use that in conditionals:
    
    if $CH2<10 then toggleChannel 12
    


    If you want to learn more about scripting, see our autoexec.bat samples:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md
    Helpful post? Buy me a coffee.
ADVERTISEMENT