@@ -92,6 +92,7 @@ class VEML7700:
92
92
ALS_800MS : 800
93
93
}
94
94
95
+ # ALS - Ambient light sensor high resolution output data
95
96
light = ROUnaryStruct (0x04 , "<H" )
96
97
"""Ambient light data.
97
98
@@ -111,6 +112,8 @@ class VEML7700:
111
112
print("Ambient light:", veml7700.light)
112
113
time.sleep(0.1)
113
114
"""
115
+
116
+ # WHITE - White channel output data
114
117
white = ROUnaryStruct (0x05 , "<H" )
115
118
"""White light data.
116
119
@@ -130,12 +133,14 @@ class VEML7700:
130
133
print("White light:", veml7700.white)
131
134
time.sleep(0.1)
132
135
"""
136
+
137
+ # ALS_CONF_0 - ALS gain, integration time, interrupt and shutdown.
133
138
light_shutdown = RWBit (0x00 , 0 , register_width = 2 )
134
139
"""Ambient light sensor shutdown. When ``True``, ambient light sensor is disabled."""
135
140
light_interrupt = RWBit (0x00 , 1 , register_width = 2 )
136
141
"""Enable interrupt. ``True`` to enable, ``False`` to disable."""
137
142
light_gain = RWBits (2 , 0x00 , 11 , register_width = 2 )
138
- """Ambient light gain setting. Gain settings are 2, 1, 1/4 and 1/8. Can be :
143
+ """Ambient light gain setting. Gain settings are 2, 1, 1/4 and 1/8. Settings options are :
139
144
ALS_GAIN_2, ALS_GAIN_1, ALS_GAIN_1_4, ALS_GAIN_1_8.
140
145
141
146
This example sets the ambient light gain to 2 and prints the ambient light sensor data.
@@ -182,10 +187,13 @@ class VEML7700:
182
187
183
188
"""
184
189
190
+ # ALS_WH - ALS high threshold window setting
185
191
light_high_threshold = UnaryStruct (0x01 , "<H" )
186
192
"""Ambient light sensor interrupt high threshold setting."""
193
+ # ALS_WL - ALS low threshold window setting
187
194
light_low_threshold = UnaryStruct (0x02 , "<H" )
188
195
"""Ambient light sensor interrupt low threshold setting."""
196
+ # ALS_INT - ALS INT trigger event
189
197
light_interrupt_high = ROBit (0x06 , 14 , register_width = 2 )
190
198
"""Ambient light high threshold interrupt flag. Triggered when high threshold exceeded."""
191
199
light_interrupt_low = ROBit (0x06 , 15 , register_width = 2 )
0 commit comments