X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/blobdiff_plain/e01b9d7b537955a47d385483a0859bef73c950d1..3d15d80420f6f61a17bf7e9c00a97863b4d96bb3:/examples/generic_aio.py diff --git a/examples/generic_aio.py b/examples/generic_aio.py index aa1df37..8e6c9c1 100644 --- a/examples/generic_aio.py +++ b/examples/generic_aio.py @@ -1,7 +1,27 @@ +# SPDX-FileCopyrightText: 2024 Brent Rubell for Adafruit Industries +# +# SPDX-License-Identifier: MIT import pytest import board import analogio +# Analog Outputs +def test_Ax_OUTPUT(): + """Test analog output pin functionality.""" + assert board.board_id == "GENERIC_AGNOSTIC_BOARD" + pin_out = analogio.AnalogOut(board.Ax_OUTPUT) + + # Test boundaries of setting the value and reading it back + pin_out.value = 0 + assert pin_out.value == 0 + pin_out.value = 65535 + assert pin_out.value == 65535 + + pin_out.deinit() + + +# Analog Inputs + # Values for sine wave # (data points = 20, amplitude=100, frequency=1) sine_wave = [