use generic variables in -no-pm code too
[EVA-2020-02-2.git] / examples / light.py
... / ...
CommitLineData
1#!/usr/bin/env python
2
3import time
4import ltr559
5
6print("""light.py - Print readings from the LTR559 Light & Proximity sensor.
7
8Press Ctrl+C to exit!
9
10""")
11
12try:
13 while True:
14 lux = ltr559.get_lux()
15 prox = ltr559.get_proximity()
16 print("""Light: {:05.02f} Lux
17Proximity: {:05.02f}
18""".format(lux, prox))
19 time.sleep(1.0)
20except KeyboardInterrupt:
21 pass