LED

LED interfaces for controlling externally connected LEDs.

Add Output Device

Item

Description

LED

Functions for controlling externally connected LEDs.


CE products: from led import *

TI-Nspire CX II: from ti_hub import *

 

 

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

var=led("port")

Command:

var=led("port")

Command
Syntax:

var=led("port")

Range:

Describe:

Creates an object for an LED.

Port can be OUT 1, OUT 2 or OUT 3

Result:

 

Type or
Addressable
Component:

Control

 

var.off()

Command:

var.off()

Command
Syntax:

var.off()

Range:

Describe:

Turns off the LED.

Result:

Type or
Addressable
Component:

Control

 

var.on()

Command:

var.on()

Command
Syntax:

var.on()

Range:

Describe:

Turns on the LED.

Result:

Type or
Addressable
Component:

Control

 

var.blink(freq,time)

Command:

var.blink(freq,time)

Command
Syntax:

var.blink(freq,time)

Python
Code
Sample:

TI Nspire CX II:

from ti_hub import *

from time import *

 

l1=led("OUT 1")

for i in range(5):

••l1.on()

••sleep(1)

••l1.off()

 

l1.blink(5,2)

 

CE products:

from led import *

from time import *

 

l1=led("OUT 1")

for i in range(5):

••l1.on()

••sleep(1)

••l1.off()

 

l1.blink(5,2)

Range:

Describe:

Blinks the LED at the specified frequency for the specified time.

frequency: 0.1 – 20 Hz

time: 0.1 – 100 seconds

Result:

Type or
Addressable
Component:

Control