Moisture

MOISTURE is the soil moisture sensor support module.

Add Input Device

Item

Description

Moisture

Returns the moisture sensor reading.


CE products: from moisture import *

TI-Nspire CX II: from ti_hub import *

 

 

The function to create the object is pasted from the menu.

var=moisture("port")

Command:

var=moisture("port")

Command
Syntax:

var=moisture("port")

Range:

Describe:

Create an object for the moisture sensor attached to the “port”.

Result:

Type or
Addressable
Component:

Control

 

var.measurement()

Command:

var.measurement()

Command Syntax:

var.measurement()

Python
Code
Sample:

TI Nspire CX II:

from ti_hub import *

m1 = moisture("IN 1")

m = m1.measurement()

print("Moisture is: ", m)

 

CE products:

from moisture import *

m1 = moisture("IN 1")

m = m1.measurement()

print("Moisture is: ", m)

Range:

Describe:

Returns the moisture value measured by the sensor.

Result:

 

Type or
Addressable
Component:

Control

 

var.range(min,max)

Command:

var.range(min,max)

Command
Syntax:

var.range(min,max)

Range:

Default range: 0 - 16383

Describe:

Sets the range of returned values for the sensor. This needs to be called before the “var.measurement()” function for it to take effect.

Result:

Type or
Addressable
Component:

Control