This object can be used to interface with analog sensors that are not explicitly supported
ANALOG.IN supports the use of analog input generic devices.
|
Item |
Description |
|---|---|
|
Analog In |
Supports the use of analog input generic devices. |
CE products: from analogin import *
TI-Nspire CX II:from ti_hub import *
|
|
|
|
The function to create the object is pasted from the menu.
|
Command: |
var=analog_in("port") |
|---|---|
|
Command |
var=analog_in("port") |
|
Range: |
|
|
Describe: |
Creates an object for the analog input sensor attached to the “port” |
|
Result: |
|
|
Type or |
Control |
|
Command: |
var.measurement() |
|---|---|
|
Command |
var.measurement() |
|
Python |
TI Nspire CX II: from ti_hub import * an1 = analog_in("BB 5") val = an1.measurement() print("Analog In value: ", val) |
|
|
CE products: from analogin import * an1 = analog_in("BB 5") val = an1.measurement() print("Analog In value: ", val) |
|
Range: |
|
|
Describe: |
Returns the sensor data value. Default range is 0 – 16383. |
|
Result: |
|
|
Type or |
Control |
|
Command: |
var.range(min,max) |
|---|---|
|
Command |
var.range(min,max) |
|
Range: |
|
|
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 |
Control |