-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from BlitzCityDIY/main
new fork for PR
- Loading branch information
Showing
5 changed files
with
302 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries | ||
# SPDX-FileCopyrightText: Copyright (c) 2023 Liz Clark for Adafruit Industries | ||
# | ||
# SPDX-License-Identifier: Unlicense | ||
# SPDX-FileCopyrightText: 2023 Liz Clark for Adafruit Industries | ||
# SPDX-License-Identifier: MIT | ||
|
||
# Simple demo to read ambient light/lux | ||
# and proximity data from VCNL4020 over I2C | ||
|
||
import time | ||
import board | ||
import adafruit_vcnl4020 | ||
|
||
i2c = board.I2C() | ||
|
||
# Initialize VCNL4020 | ||
sensor = adafruit_vcnl4020.Adafruit_VCNL4020(i2c) | ||
|
||
while True: | ||
print(f"Proximity is: {sensor.proximity}") | ||
print(f"Ambient is: {sensor.lux}") | ||
# uncomment print statement below to log to Mu plotter | ||
# print((sensor.proximity, sensor.lux,)) | ||
time.sleep(0.1) |