Digital In/Out
This object can be used to interface with digital devices that are not explicitly supported. The same object works with digital inputs as well as digital outputs.
DIGITAL provides interfaces for controlling a digital input / output pin.
Add Input Device
Item |
Description |
---|---|
Digital In |
Returns the current state of the digital pin connected to the DIGITAL object, or the cached state of the digital output value last SET to the object. |
Add Output Device
Item |
Description |
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Digital Out |
Interfaces for controlling a digital output.
|
CE products: from digital import *
TI-Nspire CX II: from ti_hub import *
|
|
|
The function to create the object is pasted from the menu.
var=digital("port")
Command: |
var=digital("port") |
---|---|
Command |
var=digital("port") |
Range: |
|
Describe: |
This object can be used to interface with digital devices that are not explicitly supported. |
Result: |
|
Type or |
Control |
var.measurement()
Command: |
var.measurement() |
---|---|
Command |
var.measurement() |
Python |
TI Nspire CX II: from ti_hub import * d1 = digital("IN 1") val = d1.measurement() print("Value is: ", val) |
|
CE products: from digital import * d1 = digital("IN 1") val = d1.measurement() print("Value is: ", val) |
Range: |
|
Describe: |
Reads the digital sensor and returns 0.0 or 1.0. |
Result: |
|
Type or |
Control |
var.set(val)
Command: |
var.set(val) |
---|---|
Command |
var.set(val) |
Range: |
|
Describe: |
Set the digital device to 0 or 1. |
Result: |
|
Type or |
Control |
var.off()
Command: |
var.off() |
---|---|
Command |
var.off() |
Range: |
|
Describe: |
Equivalent to "var.set(0)". |
Result: |
|
Type or |
Control |
var.on()
Command: |
var.on() |
---|---|
Command |
var.on() |
Range: |
|
Describe: |
Equivalent to "var.set(1)". |
Result: |
|
Type or |
Control |