Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Performing multiple commands?

General discussion about LCD Smartie.

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo, Fast351

Post Reply
firestorm_v1
Posts: 16
Joined: August 3rd, 2006, 2:53 am

Performing multiple commands?

Post by firestorm_v1 »

Here's an interesting one..

I was fortunate enough to go to a Goodwill and score a Matrix Orbital LCD for $15. Everything works as advertised (read: Excellent!!!) however I have one problem I can't wrap my brain around.

my LCD is controlling my case fans, but I want the option to manually turn up/down the fan speed via the first two GPIOs. I'd like to see if I can get both of the fans controllable by a single button. I have tried variations of the command shown below, but most result in no operation at all.
I've tried both fan statements seperated by comma, semicolon and the two fan statements in parentheses.

Any suggestions?
if $MOButton(L) =1 then Fan(1,0),Fan(2,0)
limbo
Plugin Author
Posts: 1604
Joined: February 13th, 2005, 7:38 pm
Location: Athens - Greece
Contact:

Post by limbo »

Are you sure about the MO button? If so then you have to add two different commands
if $MOButton(L) =1 then Fan(1,0)
if $MOButton(L) =1 then Fan(2,0)
firestorm_v1
Posts: 16
Joined: August 3rd, 2006, 2:53 am

Post by firestorm_v1 »

LOL, I feel like an idjit. That worked like a charm!

Based on this information, if I want to perform several actions, all I have to do under the "Actions" tab is:

if $MOButton(K) = 1 then Fan(1,254)
if $MObutton(K) = 1 then GotoScreen(20)
if $MObutton(K) = 1 then whatever_action_here

correct?
mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Post by mattcro »

I've never used more than 2 actions based on the same event, but I guess you can have as many as you need.

Smartie simply scans through all the actions each refresh interval (maybe DLL check interval), and executes any actions whose conditions have changed to the desired state.

There isn't a command to step the fan speed up (or down), but you can have a "normal" and a "gaming" fan mode for example, selected by 2 buttons.
firestorm_v1
Posts: 16
Joined: August 3rd, 2006, 2:53 am

Post by firestorm_v1 »

My testing and mattcro's response were dead on accurate.

For a while I had the down button configured to set fan 1 to low and change to display 20 which read "Fans on LOW", and the up button configured to set fan 1 to high and change to display 19 which read "fans on HIGH".

Now for the really interesting question:
Is it possible to make screen based conditional statements?
Example:
where "F1" could be used to enter some kind of rudimentary menu system and "Enter" could be used to apply that option but depending on what screen you're on, F1 may be "return to previous screen" and "enter" may be "set fans off" or "return to screen 0"?

Clear as mud?
mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Post by mattcro »

There are a few posts about menus dotted around the forum, but I don't know if anyone has a proper menu system working...

You really need multiple conditions in each action and a way to test which screen is currently active/displayed (neither of which is currently possible), like:

Code: Select all

IF $MOButton(K)=1 AND CurrentScreen=5 THEN GotoScreen(20)
I'd quite like to be able to do this sort of thing too...
Post Reply