Torque

Forums

Forums

Guest  

Show or hide header
Welcome Guest, posting in this forum require registration.




Torque » Torque OBD ECU Scanner » Torque Discussion / Ideas » Scripting: onSensorRead

Pages: [1]
Author Topic: Scripting: onSensorRead
Vasilich
Member
Posts: 218
Post Scripting: onSensorRead
on: March 28, 2022 (GMT)

Hello Ian,
it is unclear from scripting documentation:

Can function onSensorRead be defined several times, with different sensor argument in each?

onSensorRead = function(mySensor1) { do something;};
onSensorRead = function(mySensor2) { do something different;};

or is sensor argument the parameter, that is set by Torque and can be accessed in function body?

onSensorRead = function(sensorArg) { 
    if (sensorArg = mySensor1) {
        do something;
    } else if (sensorArg = mySensor2) {
        do something different;
    };
};
Pages: [1]
WP-Forum by: Fredrik Fahlstad, Version: 2.4
Page loaded in: 0.006 seconds.

  Follow me on twitter