LED RGB3

![]() | ![]() | ![]() | ![]() |
3 Smart LED Module
- Overview
- Drivers
- Samples
- Projects
LED RGB3
Key features • 3 Smart LEDs | Resources |
Function | Description |
---|---|
SetLed(index,color) | index: set LED 0-2, color: hex value |
DVer() | This driver version. |
The Code!
Modules ship with this script preloaded. Use Console to reload or modify the drivers. Additionally, some languages, such as Python, include DUELink.Engine.Record()
for recording scripts directly from the host.
fn SetLed(i, c)
r = ((c>>16)&0xff)/255
g =((c>>8)&0xff)/255
b = (c&0xff)/255
if i = 0
pwrite(1,b)
pwrite(2,r)
pwrite(3,g)
end
if i = 1
pwrite(4,b)
pwrite(5,r)
pwrite(6,g)
end
if i = 2
pwrite(7,b)
pwrite(8,r)
pwrite(11,g)
end
fend
fn DVer()
return 0.1
fend
##### User Code Starts Here #####
- Script
- Python
- JavaScript
Use Console to modify the default driver by adding this sample.
# Append this code at the bottom of the script, right after the driver.
# You MUST keep the driver code!!
i = 0
while 1
if (i = 0) # all leds are white
SetLed(0, 0xFFFFFF)
SetLed(1, 0xFFFFFF)
SetLed(2, 0xFFFFFF)
end
if (i = 1) # all leds are red
SetLed(0, 0xff0000)
SetLed(1, 0xff0000)
SetLed(2, 0xff0000)
end
if (i = 2) # all leds are green
SetLed(0, 0x00ff00)
SetLed(1, 0x00ff00)
SetLed(2, 0x00ff00)
end
if (i = 3) # all leds are blue
SetLed(0, 0x0000ff)
SetLed(1, 0x0000ff)
SetLed(2, 0x0000ff)
end
i = (i + 1) % 4
Wait(500)
wend
from DUELink.DUELinkController import DUELinkController
import time
availablePort = DUELinkController.GetConnectionPort()
duelink = DUELinkController(availablePort)
//code
Coming soon!
Ordering Info
Description | Part Number | Price |
---|---|---|
LED RGB3 | GDL-LLEDRGB3-A | $00.00 |