Digital in|out
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.
|
The Digital (input | output) module is implemented as a Python class and has methods defined as:
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: |
Creates an object for a digital device. This can be an input or an output device. |
Result: |
|
Type or |
Control |
var.measurement()
Command: |
var.measurement() |
---|---|
Command |
var.measurement() |
Python |
TI Nspire CX II: from ti_hub import * from time import *
d1=digital("BB 1") d1.on() sleep(5) d1.off() |
|
CE products: from digital import * from time import *
d1=digital("BB 1") d1.on() sleep(5) d1.off() |
Range: |
|
Describe: |
Reads the state of the digital input and returns a value of 1 or 0 to the caller. |
Result: |
|
Type or |
Control |
var.set(value)
Command: |
var.set(value) |
---|---|
Command |
var.set(value) |
Range: |
|
Describe: |
Sets the state of the digital output to “value” (0 or 1). |
Result: |
|
Type or |
Control |
var.off()
Command: |
var.off() |
---|---|
Command |
var.off() |
Range: |
|
Describe: |
Sets the state of the digital output to low (0). |
Result: |
|
Type or |
Control |
var.on()
Command: |
var.on() |
---|---|
Command |
var.on() |
Range: |
|
Describe: |
Sets the state of the digital output to high (1). |
Result: |
|
Type or |
Control |