Display update via rules

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
cratsch
New user
Posts: 2
Joined: 22 Nov 2016, 22:09

Display update via rules

#1 Post by cratsch » 22 Nov 2016, 22:29

Hi guys,
I set up a rule as follows:

Code: Select all

On Switch#State do
  If [Switch#State]=1
    oled,7,1,on
  Else
    oled,7,1,off
  Endif
Endon
This updates my OLED nicely to show "on" when I push the button "Switch", and when I release it, the display shows "off". BUT, next time I press the button, the display shows "onf" because it only overwrites the first 2 characters.

I don't want to work with the "clear" command because there's other stuff on the display that would disappear. And adding a whitespace in the rule behind "on" has no effect. Any ideas?

Thanks!

User avatar
costo
Normal user
Posts: 507
Joined: 21 Nov 2015, 15:03
Location: SW-Netherlands, NB

Re: Display update via rules

#2 Post by costo » 25 Nov 2016, 00:18

cratsch wrote:Hi guys,
I set up a rule as follows:

Code: Select all

On Switch#State do
  If [Switch#State]=1
    oled,7,1,on
  Else
    oled,7,1,off
  Endif
Endon
This updates my OLED nicely to show "on" when I push the button "Switch", and when I release it, the display shows "off". BUT, next time I press the button, the display shows "onf" because it only overwrites the first 2 characters.

I don't want to work with the "clear" command because there's other stuff on the display that would disappear. And adding a whitespace in the rule behind "on" has no effect. Any ideas?

Thanks!
If you put the whitespace in front of the text, like: " on" and "off" it will work as intended.

Who is online

Users browsing this forum: No registered users and 6 guests