Analog In

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.

Add Input Device

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.

var=analog_in("port")

Command:

var=analog_in("port")

Command
Syntax:

var=analog_in("port")

Range:

Describe:

Creates an object for the analog input 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 *

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
Addressable
Component:

Control

 

var.range(min,max)

Command:

var.range(min,max)

Command
Syntax:

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
Addressable
Component:

Control