Skip to content

Commit 3f29a61

Browse files
committed
fix copyright
1 parent 211f6fa commit 3f29a61

File tree

3 files changed

+65
-2
lines changed

3 files changed

+65
-2
lines changed

examples/nonblocking_serialinput_advanced.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

4-
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
54
# SPDX-FileCopyrightText: Copyright (c) 2021 Stefan Krüger for s-light
65
#
76
# SPDX-License-Identifier: Unlicense

examples/nonblocking_serialinput_advanced_class.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

4-
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
54
# SPDX-FileCopyrightText: Copyright (c) 2021 Stefan Krüger for s-light
65
#
76
# SPDX-License-Identifier: Unlicense
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
4+
# SPDX-FileCopyrightText: Copyright (c) 2021 Stefan Krüger s-light
5+
#
6+
# SPDX-License-Identifier: Unlicense
7+
8+
"""Development things,"""
9+
10+
import time
11+
import board
12+
import digitalio
13+
import nonblocking_serialinput as nb_serialin
14+
15+
##########################################
16+
# globals
17+
led = digitalio.DigitalInOut(board.LED)
18+
led.direction = digitalio.Direction.OUTPUT
19+
20+
##########################################
21+
# menu
22+
23+
my_input = nb_serialin.NonBlockingSerialInput()
24+
25+
##########################################
26+
# main
27+
28+
29+
def main():
30+
"""Main."""
31+
# wait for serial terminal to get ready..
32+
time.sleep(1)
33+
print("")
34+
print("nonblocking_serialinput_simpletest.py")
35+
print(42 * "*")
36+
37+
runtime_print_next = time.monotonic()
38+
runtime_print_intervall = 1.0
39+
running = True
40+
while running:
41+
# input handling
42+
my_input.update()
43+
input_string = my_input.input()
44+
if input_string is not None:
45+
# print("input_string: {}".format(repr(input_string)))
46+
# we have at least a empty string.
47+
if "exit" in input_string:
48+
print("Stop Program running.")
49+
running = False
50+
elif "hello" in input_string:
51+
print("World :-)")
52+
else:
53+
print("type 'exit' to stop the program.")
54+
# live sign
55+
if runtime_print_next < time.monotonic():
56+
runtime_print_next = time.monotonic() + runtime_print_intervall
57+
print("{: > 7.2f}s".format(time.monotonic()))
58+
led.value = not led.value
59+
60+
61+
##########################################
62+
if __name__ == "__main__":
63+
main()
64+
65+
##########################################

0 commit comments

Comments
 (0)