Simple test
Ensure your device works with this simple test.
examples/noise_simpletest.py
1# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2# SPDX-FileCopyrightText: Copyright (c) 2023 Tod Kurt
3#
4# SPDX-License-Identifier: Unlicense
5
6"""
7Print an undulating terrain to the console with asterisks.
8"""
9
10import time
11
12from noise import noise
13
14i = 0
15while True:
16 n = noise(0.02 * i) # get a 1D noise value
17 i += 1
18 # print a random terrain with asterisks
19 print(" " * int(max(n + 1, 0) * 40), "*")
20 time.sleep(0.01)