User manual
010 for(i = 0; i < 16 – (c1 + (c2 ? 1 : 0)); ++i)
011 lcd.write(byte(0))
The loop deletes the superfluous characters from the LCD by
determining how long the area that is not used is and overwriting
it with spaces.
A little know-how is needed for the bar chart display, but once
it has been understood, it can be used easily in many appli-
cations.
LIGHT METER – THE
PHOTOMETER
A photometer is a meter to determine the light density or light
strength. It is used, e.g. by photographers as lighting meter
or in astronomy to determine the brightness of stars.
In chemistry, it is used to determine concentrations. In the last
experiment, we programmed a bar chart display; this time, instead
of the up/down counter, we will hand over a true physical value
and program a simple photometer.
The circuit diagram shows how the photo transistor is connected
to the analogue input (ADC) of the Arduino™-board. The photo
transistor is not easy to tell from a regular LED. It has a clear,
transparent housing, but that is true for some LEDs as well. If
you are not sure if you have an LED or a photo transistor, you
can check the behaviour with a multimeter set to measuring
resistances. For this, connect the collector (C – flattened side
of the housing) to the pulse line and the emitter (E) to the minus
line of the meter. If you darken a photo transistor, the re-
sistance value will change enormously. In an LED, the effect will
be tiny. Multimeters with an auto range function are ideal here
because the measured value can be between a few Kiloohm and
several Megaohm.
Example code: PHOTOMETER
001 // Integrating LCD-Library
002 #include <LiquidCrystal.h>
003
004 // Specifying LCD pins
005 // RS, E, D4, D5, D6, D7