lightsensor

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package lightsensor reads an IIO ambient light sensor through sysfs: in_illuminance_input in lux where the driver processes the value, else (in_illuminance_raw + in_illuminance_offset) × in_illuminance_scale as the IIO ABI defines it, an absent offset being 0 and an absent scale 1.

Index

Constants

This section is empty.

Variables

View Source
var ErrNone = errors.New("no IIO ambient light sensor")

ErrNone is an IIO bus without an ambient light sensor, or no IIO bus.

Functions

This section is empty.

Types

type Sensor

type Sensor struct {
	// contains filtered or unexported fields
}

Sensor is one IIO ambient light sensor.

func Find

func Find(root string) (Sensor, error)

Find returns the first IIO device under root, in name order, that reads illuminance; ErrNone when there is none.

func (Sensor) Sample

func (s Sensor) Sample(context.Context) (ambient.Lux, error)

Sample reads the illuminance.

func (Sensor) String

func (s Sensor) String() string

String names the sensor and where it is.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL