NAME

	RPi::I2C::LUX - Interface vi I2C to the TSL2561 lux sensor

SYNOPSIS

	use RPi::I2C::LUX

	# all option values have defaults
	my $device = RPi::I2C::LUX->new(
		'devaddr'	=> <I2C address>,
		'busno'		=> <RPi bus number for I2C interface: 0 or 1>,
		);

	@vals = $device->readVal

DESCRIPTION

	Interface to read from a TSL2561 lux sensor

YOU SHOULD KNOW

	RPi::I2C is prerequisite and its documentation specifies requirements
	for enabling the I2C bus and determining the bus address to use.

	Datasheet at https://cdn-shop.adafruit.com/datasheets/TSL2561.pdf
	Hardware configuration: https://cdn-shop.adafruit.com/datasheets/TSL2561.pdf

METHODS

	new([options])
		
		Instantiates an object representing the attached sensor.

		Parameters

			Every option has a default value, and the defaults may be sufficient 
			for most applications.

			my $device = RPi::I2C::LUX->new(
				'devaddr'	=> <I2C address>,
					default 0x39
				'busno'		=> <RPi bus number for I2C interface: 0 or 1>,
					default 1, for /dev/i2c-1
				);

	readVal

		Reads the sensor and returns an array.  Element 0 is infared+visible.
		Element 1 is visible light.

EXAMPLE

	#!/usr/bin/perl
	use RPi::I2C;
	use RPi::I2C::LUX;

	my $lux = RPi::I2C::LUX->new;
	my @vals = $lux->readVal;
	print "IR+visible=$vals[0], visible=$vals[1]\n";

AUTHOR

	Todd Merriman, <todd at toolz dot com>, 
	d.b.a. Software Toolz, Atlanta, Georgia

LICENSE AND COPYRIGHT

	Copyright (C) 2023 by Todd Merriman d.b.a. Software Toolz

	This library is free software; you can redistribute it and/or modify it
	under the same terms as Perl itself.

