Store current pressure

Post your questions and help other users.

Moderator: Martin

Post Reply
DashDriver
Posts: 3
Joined: 26 Nov 2014 19:08

Store current pressure

Post by DashDriver » 05 Dec 2014 07:18

I need to take the current value from the pressure sensor and store it in a global variable. Whenever I try, however, pressure comes up as having a null value. Anyone have an idea what's going on?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Store current pressure

Post by Martin » 05 Dec 2014 09:51

Hi,

A flow like this should work:
-trigger ...
-condition Pressure Sensor: > 0mbar
--> true: -action Script: global_pressure = pressure;

Please note that the condition only works when the device allows to read the pressure sensor values when the screen is off and when the sensor allows to read the current value, otherwise the flow will stop with a timeout error.

Regards,
Martin

DashDriver
Posts: 3
Joined: 26 Nov 2014 19:08

Re: Store current pressure

Post by DashDriver » 05 Dec 2014 23:01

Thanks Martin! It seems that the Pressure Sensor: > 0mbar condition is necessary before you can capture the current pressure in a variable.

Post Reply