Color

This object controls the on-board RGB LED of the TI-Innovator™ Hub.

TI-Nspire CX II:from ti_hub import *

CE products: import color

 

 

 

color.rgb()

Command:

color.rgb()

Command Syntax:

color.rgb(red, green, blue)

Range:

red = [0, 255]

green = [0, 255]

blue = [0, 255]

Describe:

Controls on-board RGB LED.

Example:

color.rgb(255,0,255) – sets the color of the RGB LED to purple (red and blue)

 

Note: Setting all three to 255 will make the RGB LED turn bright white. All 0s will turn it OFF

Result:

Sets the on-board RGB LED to the color specified by the values.

Type or
Addressable Component:

Control

 

color.blink()

Command:

color.blink()

Command Syntax:

color.blink(frequency, time)

Range:

frequency = [0.1, 20]

time = [0.1, 100]

Describe:

Set blink frequency and duration for on-board RGB LED.

Example:

color.rgb(255,0,255) # Set LED to purple

color.blink(4, 5) # Make it blink 4 times a second for 5 seconds

Note: The color needs to be specified before the blink function is called.

Result:

NA

Type or
Addressable Component:

Control

 

color.off()

Command:

color.off

Command
Syntax:

color.off()

Range:

 

Describe:

Turns off on-board RGB LED.

This is equivalent to “color.rgb(0,0,0)”

Result:

The LED turns OFF.

Type or
Addressable
Component:

Control