timed logic in control

40 views
Skip to first unread message

Артем ТИхонович

unread,
Nov 2, 2017, 5:13:31 AM11/2/17
to souliss
Hi friends.
I need to make simple algoryth to control device depending on digital input.
If  digital input was HIGH  more than several (configurable)  minutes then i switch device ON  to several(configurable) minutes. 
How can i get  value - how many time the digital input was high?

Артем ТИхонович

unread,
Nov 2, 2017, 7:43:50 AM11/2/17
to souliss
i can implement this using standart arduino language using millis() but may be souliss have special commands for this.
 

четверг, 2 ноября 2017 г., 12:13:31 UTC+3 пользователь Артем ТИхонович написал:

Di Maio, Dario

unread,
Nov 4, 2017, 5:00:26 AM11/4/17
to sou...@googlegroups.com
Hi,

you are free to use millis() as most of Souliss timing are based on this. You cannot use delay() instead, as this will affect background processes.

Regards,
Dario.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+unsubscribe@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/cb7b4a87-4f20-496d-bbff-684ffd238b0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Артем ТИхонович

unread,
Nov 6, 2017, 6:31:58 AM11/6/17
to souliss
Thank you, Dario!

Does it correct code parts?
I just want to set HUMISET level from soulis android app and ON FANHIGH  if the humidity from DHT22 higher than HUMISET value.
I try to find some examples with T63 logic but unfortunately. 

#define HUMIDITY              0

.
.


#define HUMISET               7

Set_T63(HUMISET);

...
     
Set_Humidity(HUMIDITY);
     
Set_T63(HUMISET);



 
if (mOutput(HUMISET)<mOutput(HUMIDITY))
 mInput
(FAN_HIGH) = Souliss_T1n_OnCmd;


.....

SLOW_50s() {
humidity = dht.readHumidity();
//if (!isnan(humidity) {
ImportAnalog(HUMIDITY, &humidity);
//}

}



....

Артем ТИхонович

unread,
Nov 6, 2017, 6:57:29 AM11/6/17
to souliss

How can i compare to analog values measred and setpoint? Does it correct to compare using mOutput(HUMIDITY) or i must use another ways based on souliss instructions?


четверг, 2 ноября 2017 г., 12:13:31 UTC+3 пользователь Артем ТИхонович написал:
Hi friends.

Артем ТИхонович

unread,
Nov 7, 2017, 6:51:07 AM11/7/17
to souliss
i just to this with this construction:
if (Souliss_SinglePrecisionFloating(&mOutput((HUMISET))) <Souliss_SinglePrecisionFloating(&mOutput((HUMIDITY))))
it's work


четверг, 2 ноября 2017 г., 12:13:31 UTC+3 пользователь Артем ТИхонович написал:
Hi friends.
Reply all
Reply to author
Forward
0 new messages