RGB
RGB support for controlling external RGB LEDs.
Add Output Device
Item |
Description |
---|---|
RGB |
Support for controlling external RGB LEDs. |
CE products: from rgb import *
TI-Nspire CX II:from ti_hub import *
|
|
|
The function to create the object is pasted from the menu.
var=rgb("port")
Command: |
var=rgb("port") |
---|---|
Command |
var=rgb("port") |
Range: |
|
Describe: |
Creates an object for an RGB LED. Port can be OUT 1, OUT 2 or OUT 3
CE module: var=rgb(“r”, “g”, “b”) – allows connecting an RGB LED to three different breadboard pins or to the same OUT port. |
Result: |
|
Type or |
Control |
var.rgb(r,g,b)
Command: |
var.rgb(r,g,b) |
---|---|
Command |
var.rgb(r,g,b) |
Range: |
|
Describe: |
Sets the color of the RGB LED to the color specified by the ‘r’ (red), ‘g’(green), ‘b’(blue) values. r, g, b all are between 0 and 255. |
Result: |
|
Type or |
Control |
var.blink(freq,time)
Command: |
var.blink(freq,time) |
---|---|
Command |
var.blink(freq,time) |
Python |
TI Nspire CX II: from ti_hub import * rgb1=rgb("OUT 2") rgb1.rgb(255,0,255) rgb1.blink(4,4) |
|
CE products: from rgb import * rgb1=rgb("OUT 2", "OUT 2", "OUT 2") rgb1.rgb(255,0,255) rgb1.blink(4,4) |
Range: |
|
Describe: |
Blinks the RGB LED at the specified frequency for the specified time. frequency: 0.1 – 20 Hz time: 0.1 – 100 seconds Note tha.t var.rgb() will need to be called first to set the color of the RGB LED |
Result: |
|
Type or |
Control |
var.off()
Command: |
var.off() |
---|---|
Command |
var.off() |
Range: |
|
Describe: |
Turns off the RGB LED. |
Result: |
|
Type or |
Control |