Simple test

Ensure your device works with this simple test.

examples/pioasm_simpletest.py
 1# SPDX-FileCopyrightText: 2021 Scott Shawcroft, written for Adafruit Industries
 2#
 3# SPDX-License-Identifier: MIT
 4
 5import time
 6import rp2pio
 7import board
 8import adafruit_pioasm
 9
10squarewave = """
11.program squarewave
12    set pins 1      ; Drive pin high and then delay for one cycle
13    set pins 0      ; Drive pin low
14"""
15
16assembled = adafruit_pioasm.assemble(squarewave)
17
18sm = rp2pio.StateMachine(
19    assembled,
20    frequency=1000 * 2,
21    first_set_pin=board.D13,
22)
23print("real frequency", sm.frequency)
24
25time.sleep(120)