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
11from noise import noise
12
13i = 0
14while True:
15 n = noise(0.02 * i) # get a 1D noise value
16 i += 1
17 # print a random terrain with asterisks
18 print(" " * int(max(n + 1, 0) * 40), "*")
19 time.sleep(0.01)