LightLevel (Light Sensor)

LIGHTLEVEL supports reading external light level sensors.

Add Input Device

Item

Description

Light Level

Returns the brightness level from the external light level (brightness) sensor.


CE products: from lightlvl import *

TI-Nspire CX II: from ti_hub import *

 

 

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

var=light_level("port")

Command:

var=light_level("port")

Command
Syntax:

var=light_level("port")

Range:

Describe:

Create an object for the light level sensor attached to the “port”.

Result:

Type or
Addressable
Component:

Control

 

var.measurement()

Command:

var.measurement()

Command Syntax:

var.measurement()

Python
Code
Sample:

TI Nspire CX II:

from ti_hub import *

l1 = light_level("IN 1")

b = l1.measurement()

print("Light level is: ", b)

 

CE products:

from lightlvl import *

l1 = light_level("IN 1")

b = l1.measurement()

print("Light level is: ", b)

Range:

Describe:

Returns the relative brightness between 0 and 100 measured by the sensor.

Result:

 

Type or
Addressable
Component:

Control

 

var.range(min,max)

Command:

var.range(min,max)

Command
Syntax:

var.range(min,max)

Range:

Describe:

Sets the range of returned values for the sensor. This needs to be called before the “var.measurement()” function for it to take effect.

Result:

Type or
Addressable
Component:

Control