Skip to content

Commit bee9aa1

Browse files
committed
Flesh out simple example
1 parent 7e158d8 commit bee9aa1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

examples/mics6814_simpletest.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
11
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
22
#
33
# SPDX-License-Identifier: Unlicense
4+
"""Simple example of the MICS6814 library."""
5+
import time
6+
import analogio
7+
import digitalio
8+
import board
9+
from pimoroni_mics6814 import Pimoroni_MICS6814
10+
11+
PIN_NH3 = analogio.AnalogIn(board.A0)
12+
PIN_RED = analogio.AnalogIn(board.A1)
13+
PIN_OX = analogio.AnalogIn(board.A2)
14+
PIN_ENABLE = digitalio.DigitalInOut(board.A4)
15+
16+
MICS6814 = Pimoroni_MICS6814(PIN_OX, PIN_RED, PIN_NH3, PIN_ENABLE)
17+
18+
while True:
19+
print(MICS6814.read_all())
20+
time.sleep(1.0)

0 commit comments

Comments
 (0)