/ examples / waveform_square_simpletest.py
waveform_square_simpletest.py
 1  """
 2  'square_demo.py'.
 3  
 4  =================================================
 5  toggles the builtin LED using a square wave
 6  """
 7  import time
 8  import digitalio
 9  import board
10  from adafruit_waveform import square
11  
12  LED = digitalio.DigitalInOut(board.D13)
13  LED.switch_to_output()
14  SAMPLE_SQUARE = square.square_wave(2)
15  
16  while True:
17      for i in range(len(SAMPLE_SQUARE)):
18          LED.value = i
19          print(LED.value)
20          time.sleep(0.5)