Light

![]() | ![]() | ![]() | ![]() |
Light Level Sensor
- Overview
- Drivers
- Samples
- Projects
Light Level Sensor
Key features • On-board light sensor | Resources |
These Beyond the Standard Library, these functions are provided.
Function | Description | Use |
---|---|---|
Light() | Return value from 0 to 100. | |
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.
##### Driver Code Starts Here ###
fn Light()
return trunc(vread(1)/(readvcc() )*100)
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!!
While 1
println(Light())
Wait(1000)
wend
from DUELink.DUELinkController import DUELinkController
import time
availablePort = DUELinkController.GetConnectionPort()
duelink = DUELinkController(availablePort)
//code
Coming soon!
Ordering Info
Description | Part Number | Price |
---|---|---|
Light Sensor | GDL-SELIGHT-A | $00.00 |