diff --git a/CPX_DAC_Guide/adafruit_logo_vector.py b/CPX_DAC_Guide/adafruit_logo_vector.py index 9bdcf3822..3ca9be4da 100644 --- a/CPX_DAC_Guide/adafruit_logo_vector.py +++ b/CPX_DAC_Guide/adafruit_logo_vector.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2019 Anne Barela for Adafruit Industries +# +# SPDX-License-Identifier: MIT + ### Adafruit logo """Adafruit logo created from bitmap, diff --git a/CPX_DAC_Guide/code.py b/CPX_DAC_Guide/code.py index 359e3af19..8f3cc7363 100644 --- a/CPX_DAC_Guide/code.py +++ b/CPX_DAC_Guide/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2019 Kevin J. Walters for Adafruit Industries +# +# SPDX-License-Identifier: MIT + ### scope-xy-adafruitlogo v1.0 """Output a logo to an oscilloscope in X-Y mode on an Adafruit M4 diff --git a/CPX_DAC_Guide/python/pngtowav.py b/CPX_DAC_Guide/python/pngtowav.py index ebcbe26c6..ebd593313 100644 --- a/CPX_DAC_Guide/python/pngtowav.py +++ b/CPX_DAC_Guide/python/pngtowav.py @@ -1,173 +1,177 @@ -#!/usr/bin/python3 - -### pngtowav v1.0 -"""Convert a list of png images to pseudo composite video in wav file form. - -This is Python code not intended for running on a microcontroller board. -""" - -### MIT License - -### Copyright (c) 2019 Kevin J. Walters - -### Permission is hereby granted, free of charge, to any person obtaining a copy -### of this software and associated documentation files (the "Software"), to deal -### in the Software without restriction, including without limitation the rights -### to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -### copies of the Software, and to permit persons to whom the Software is -### furnished to do so, subject to the following conditions: - -### The above copyright notice and this permission notice shall be included in all -### copies or substantial portions of the Software. - -### THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -### IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -### FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -### AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -### LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -### OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -### SOFTWARE. - -import getopt -import sys -import array -import wave - -import imageio - - -### globals -### pylint: disable=invalid-name -### start_offset of 1 can help if triggering on oscilloscope -### is missing alternate lines -debug = 0 -verbose = False -movie_file = False -output_filename = "dacanim.wav" -fps = 50 -threshold = 128 ### pixel level -replaceforsync = False -start_offset = 1 - -max_dac_v = 3.3 -### 16 bit wav files always use signed representation for data -dac_offtop = 2**15-1 ### 3.30V -dac_sync = -2**15 ### 0.00V -### image from 3.00V to 0.30V -dac_top = round(3.00 / max_dac_v * (2**16-1)) - 2**15 -dac_bottom = round(0.30 / max_dac_v * (2**16-1)) - 2**15 - - -def usage(exit_code): ### pylint: disable=missing-docstring - print("pngtowav: " - + "[-d] [-f fps] [-h] [-m] [-o outputfilename] [-r] [-s lineoffset] [-t threshold] [-v]", - file=sys.stderr) - if exit_code is not None: - sys.exit(exit_code) - - -def image_to_dac(img, row_offset, first_pix, dac_y_range): - """Convert a single image to DAC output.""" - dac_out = array.array("h", []) - - img_height, img_width = img.shape - if verbose: - print("W,H", img_width, img_height) - - for row_o in range(img_height): - row = (row_o + row_offset) % img_height - ### Currently using 0 to (n-1)/n range - y_pos = round(dac_top - row / (img_height - 1) * dac_y_range) - if verbose: - print("Adding row", row, "at y_pos", y_pos) - dac_out.extend(array.array("h", - [dac_sync] - + [y_pos if x >= threshold else dac_offtop - for x in img[row, first_pix:]])) - return dac_out, img_width, img_height - - -def write_wav(filename, data, framerate): - """Create one channel 16bit wav file.""" - wav_file = wave.open(filename, "w") - nchannels = 1 - sampwidth = 2 - nframes = len(data) - comptype = "NONE" - compname = "not compressed" - if verbose: - print("Writing wav file", filename, "at rate", framerate, - "with", nframes, "samples") - wav_file.setparams((nchannels, sampwidth, framerate, nframes, - comptype, compname)) - wav_file.writeframes(data) - wav_file.close() - - -def main(cmdlineargs): ### pylint: disable=too-many-branches - """main(args)""" - global debug, fps, movie_file, output_filename, replaceforsync ### pylint: disable=global-statement - global threshold, start_offset, verbose ### pylint: disable=global-statement - - try: - opts, args = getopt.getopt(cmdlineargs, - "f:hmo:rs:t:v", ["help", "output="]) - except getopt.GetoptError as err: - print(err, - file=sys.stderr) - usage(2) - for opt, arg in opts: - if opt == "-d": ### pylint counts these towards too-many-branches :( - debug = 1 - elif opt == "-f": - fps = int(arg) - elif opt in ("-h", "--help"): - usage(0) - elif opt == "-m": - movie_file = True - elif opt in ("-o", "--output"): - output_filename = arg - elif opt == "-r": - replaceforsync = True - elif opt == "-s": - start_offset = int(arg) - elif opt == "-t": - threshold = int(arg) - elif opt == "-v": - verbose = True - else: - print("Internal error: unhandled option", - file=sys.stderr) - sys.exit(3) - - dac_samples = array.array("h", []) - - ### Decide whether to replace first column with sync pulse - ### or add it as an additional column - first_pix = 1 if replaceforsync else 0 - - ### Read each frame, either - ### many single image filenames in args or - ### one or more video (animated gifs) (needs -m on command line) - dac_y_range = dac_top - dac_bottom - row_offset = 0 - for arg in args: - if verbose: - print("PROCESSING", arg) - if movie_file: - images = imageio.mimread(arg) - else: - images = [imageio.imread(arg)] - - for img in images: - img_output, width, height = image_to_dac(img, row_offset, - first_pix, dac_y_range) - dac_samples.extend(img_output) - row_offset += start_offset - - write_wav(output_filename, dac_samples, - (width + (1 - first_pix)) * height * fps) - - -if __name__ == "__main__": - main(sys.argv[1:]) +# SPDX-FileCopyrightText: 2019 Kevin J. Walters for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +#!/usr/bin/python3 + +### pngtowav v1.0 +"""Convert a list of png images to pseudo composite video in wav file form. + +This is Python code not intended for running on a microcontroller board. +""" + +### MIT License + +### Copyright (c) 2019 Kevin J. Walters + +### Permission is hereby granted, free of charge, to any person obtaining a copy +### of this software and associated documentation files (the "Software"), to deal +### in the Software without restriction, including without limitation the rights +### to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +### copies of the Software, and to permit persons to whom the Software is +### furnished to do so, subject to the following conditions: + +### The above copyright notice and this permission notice shall be included in all +### copies or substantial portions of the Software. + +### THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +### IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +### FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +### AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +### LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +### OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +### SOFTWARE. + +import getopt +import sys +import array +import wave + +import imageio + + +### globals +### pylint: disable=invalid-name +### start_offset of 1 can help if triggering on oscilloscope +### is missing alternate lines +debug = 0 +verbose = False +movie_file = False +output_filename = "dacanim.wav" +fps = 50 +threshold = 128 ### pixel level +replaceforsync = False +start_offset = 1 + +max_dac_v = 3.3 +### 16 bit wav files always use signed representation for data +dac_offtop = 2**15-1 ### 3.30V +dac_sync = -2**15 ### 0.00V +### image from 3.00V to 0.30V +dac_top = round(3.00 / max_dac_v * (2**16-1)) - 2**15 +dac_bottom = round(0.30 / max_dac_v * (2**16-1)) - 2**15 + + +def usage(exit_code): ### pylint: disable=missing-docstring + print("pngtowav: " + + "[-d] [-f fps] [-h] [-m] [-o outputfilename] [-r] [-s lineoffset] [-t threshold] [-v]", + file=sys.stderr) + if exit_code is not None: + sys.exit(exit_code) + + +def image_to_dac(img, row_offset, first_pix, dac_y_range): + """Convert a single image to DAC output.""" + dac_out = array.array("h", []) + + img_height, img_width = img.shape + if verbose: + print("W,H", img_width, img_height) + + for row_o in range(img_height): + row = (row_o + row_offset) % img_height + ### Currently using 0 to (n-1)/n range + y_pos = round(dac_top - row / (img_height - 1) * dac_y_range) + if verbose: + print("Adding row", row, "at y_pos", y_pos) + dac_out.extend(array.array("h", + [dac_sync] + + [y_pos if x >= threshold else dac_offtop + for x in img[row, first_pix:]])) + return dac_out, img_width, img_height + + +def write_wav(filename, data, framerate): + """Create one channel 16bit wav file.""" + wav_file = wave.open(filename, "w") + nchannels = 1 + sampwidth = 2 + nframes = len(data) + comptype = "NONE" + compname = "not compressed" + if verbose: + print("Writing wav file", filename, "at rate", framerate, + "with", nframes, "samples") + wav_file.setparams((nchannels, sampwidth, framerate, nframes, + comptype, compname)) + wav_file.writeframes(data) + wav_file.close() + + +def main(cmdlineargs): ### pylint: disable=too-many-branches + """main(args)""" + global debug, fps, movie_file, output_filename, replaceforsync ### pylint: disable=global-statement + global threshold, start_offset, verbose ### pylint: disable=global-statement + + try: + opts, args = getopt.getopt(cmdlineargs, + "f:hmo:rs:t:v", ["help", "output="]) + except getopt.GetoptError as err: + print(err, + file=sys.stderr) + usage(2) + for opt, arg in opts: + if opt == "-d": ### pylint counts these towards too-many-branches :( + debug = 1 + elif opt == "-f": + fps = int(arg) + elif opt in ("-h", "--help"): + usage(0) + elif opt == "-m": + movie_file = True + elif opt in ("-o", "--output"): + output_filename = arg + elif opt == "-r": + replaceforsync = True + elif opt == "-s": + start_offset = int(arg) + elif opt == "-t": + threshold = int(arg) + elif opt == "-v": + verbose = True + else: + print("Internal error: unhandled option", + file=sys.stderr) + sys.exit(3) + + dac_samples = array.array("h", []) + + ### Decide whether to replace first column with sync pulse + ### or add it as an additional column + first_pix = 1 if replaceforsync else 0 + + ### Read each frame, either + ### many single image filenames in args or + ### one or more video (animated gifs) (needs -m on command line) + dac_y_range = dac_top - dac_bottom + row_offset = 0 + for arg in args: + if verbose: + print("PROCESSING", arg) + if movie_file: + images = imageio.mimread(arg) + else: + images = [imageio.imread(arg)] + + for img in images: + img_output, width, height = image_to_dac(img, row_offset, + first_pix, dac_y_range) + dac_samples.extend(img_output) + row_offset += start_offset + + write_wav(output_filename, dac_samples, + (width + (1 - first_pix)) * height * fps) + + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/CPX_DAC_Guide/python/svgtopy.py b/CPX_DAC_Guide/python/svgtopy.py index 5370e2b88..43ef61fe3 100644 --- a/CPX_DAC_Guide/python/svgtopy.py +++ b/CPX_DAC_Guide/python/svgtopy.py @@ -1,134 +1,138 @@ -#!/usr/bin/python3 - -### svgtopy v1.0 -"""Print vectors from an SVG input file in python list format -for easy pasting into a program. - -This is Python code not intended for running on a microcontroller board. -""" - -### MIT License - -### Copyright (c) 2019 Kevin J. Walters - -### Permission is hereby granted, free of charge, to any person obtaining a copy -### of this software and associated documentation files (the "Software"), to deal -### in the Software without restriction, including without limitation the rights -### to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -### copies of the Software, and to permit persons to whom the Software is -### furnished to do so, subject to the following conditions: - -### The above copyright notice and this permission notice shall be included in all -### copies or substantial portions of the Software. - -### THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -### IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -### FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -### AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -### LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -### OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -### SOFTWARE. - - -### it only understands M and L in SVG - -### Worth looking at SVG libraries to see if they -### can parse/transform SVG data - -import getopt -import sys -import re -##import fileinput -import xml.etree.ElementTree as ET - -### globals -### pylint: disable=invalid-name -debug = 0 -verbose = False - - -def usage(exit_code): ### pylint: disable=missing-docstring - print("""Usage: svgtopy [-d] [-h] [-v] [--help] -Convert an svg file from from standard input to comma-separated tuples -on standard output for inclusion as a list in a python program.""", - file=sys.stderr) - if exit_code is not None: - sys.exit(exit_code) - - -def search_path_d(svgdata, point_groups): - """Look for M and L in the SVG d attribute of a path node""" - - points = [] - for match in re.finditer(r"([A-Za-z])([\d\.]+)\s+([\d\.]+)\s*", svgdata): - if match: - cmd = match.group(1) - if cmd == "M": ### Start of a new part - mx, my = match.group(2, 3) - if points: - point_groups.append(points) - points = [] - points.append((float(mx), float(my))) - if debug: - print("M pos", mx, my) - - elif cmd == "L": ### Continuation of current part - lx, ly = match.group(2, 3) - points.append((float(lx), float(ly))) - if debug: - print("L pos", lx, ly) - - else: - print("SVG cmd not implemented:", cmd, - file=sys.stderr) - else: - print("some parsing issue", - file=sys.stderr) - - # Add the last part to point_groups - if points: - point_groups.append(points) - points = [] - - -def main(cmdlineargs): - """main(args)""" - global debug, verbose ### pylint: disable=global-statement - - try: - opts, _ = getopt.getopt(cmdlineargs, - "dhv", ["help"]) - except getopt.GetoptError as err: - print(err, - file=sys.stderr) - usage(2) - for opt, _ in opts: - if opt == "-d": - debug = True - elif opt == "-v": - verbose = True - elif opt in ("-h", "--help"): - usage(0) - else: - print("Internal error: unhandled option", - file=sys.stderr) - sys.exit(3) - - xml_ns = {"svg": "http://www.w3.org/2000/svg"} - tree = ET.parse(sys.stdin) - point_groups = [] - for path in tree.findall("svg:path", xml_ns): - svgdata = path.attrib["d"] - if verbose: - print("Processing path with {0:d} length".format(len(svgdata))) - search_path_d(svgdata, point_groups) - - - - for idx, points in enumerate(point_groups): - print("# Group", idx + 1) - for point in points: - print(" ", point, ",", sep="") - -if __name__ == "__main__": - main(sys.argv[1:]) +# SPDX-FileCopyrightText: 2019 Kevin J. Walters for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +#!/usr/bin/python3 + +### svgtopy v1.0 +"""Print vectors from an SVG input file in python list format +for easy pasting into a program. + +This is Python code not intended for running on a microcontroller board. +""" + +### MIT License + +### Copyright (c) 2019 Kevin J. Walters + +### Permission is hereby granted, free of charge, to any person obtaining a copy +### of this software and associated documentation files (the "Software"), to deal +### in the Software without restriction, including without limitation the rights +### to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +### copies of the Software, and to permit persons to whom the Software is +### furnished to do so, subject to the following conditions: + +### The above copyright notice and this permission notice shall be included in all +### copies or substantial portions of the Software. + +### THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +### IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +### FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +### AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +### LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +### OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +### SOFTWARE. + + +### it only understands M and L in SVG + +### Worth looking at SVG libraries to see if they +### can parse/transform SVG data + +import getopt +import sys +import re +##import fileinput +import xml.etree.ElementTree as ET + +### globals +### pylint: disable=invalid-name +debug = 0 +verbose = False + + +def usage(exit_code): ### pylint: disable=missing-docstring + print("""Usage: svgtopy [-d] [-h] [-v] [--help] +Convert an svg file from from standard input to comma-separated tuples +on standard output for inclusion as a list in a python program.""", + file=sys.stderr) + if exit_code is not None: + sys.exit(exit_code) + + +def search_path_d(svgdata, point_groups): + """Look for M and L in the SVG d attribute of a path node""" + + points = [] + for match in re.finditer(r"([A-Za-z])([\d\.]+)\s+([\d\.]+)\s*", svgdata): + if match: + cmd = match.group(1) + if cmd == "M": ### Start of a new part + mx, my = match.group(2, 3) + if points: + point_groups.append(points) + points = [] + points.append((float(mx), float(my))) + if debug: + print("M pos", mx, my) + + elif cmd == "L": ### Continuation of current part + lx, ly = match.group(2, 3) + points.append((float(lx), float(ly))) + if debug: + print("L pos", lx, ly) + + else: + print("SVG cmd not implemented:", cmd, + file=sys.stderr) + else: + print("some parsing issue", + file=sys.stderr) + + # Add the last part to point_groups + if points: + point_groups.append(points) + points = [] + + +def main(cmdlineargs): + """main(args)""" + global debug, verbose ### pylint: disable=global-statement + + try: + opts, _ = getopt.getopt(cmdlineargs, + "dhv", ["help"]) + except getopt.GetoptError as err: + print(err, + file=sys.stderr) + usage(2) + for opt, _ in opts: + if opt == "-d": + debug = True + elif opt == "-v": + verbose = True + elif opt in ("-h", "--help"): + usage(0) + else: + print("Internal error: unhandled option", + file=sys.stderr) + sys.exit(3) + + xml_ns = {"svg": "http://www.w3.org/2000/svg"} + tree = ET.parse(sys.stdin) + point_groups = [] + for path in tree.findall("svg:path", xml_ns): + svgdata = path.attrib["d"] + if verbose: + print("Processing path with {0:d} length".format(len(svgdata))) + search_path_d(svgdata, point_groups) + + + + for idx, points in enumerate(point_groups): + print("# Group", idx + 1) + for point in points: + print(" ", point, ",", sep="") + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/CircuitPython_KeyPad_Calculator/code/code.py b/CircuitPython_KeyPad_Calculator/code/code.py index 7a63c680c..26c39de7b 100644 --- a/CircuitPython_KeyPad_Calculator/code/code.py +++ b/CircuitPython_KeyPad_Calculator/code/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2021 Jeff Epler for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import board import displayio import keypad diff --git a/Introducing_Gemma_M0/Gemma_AnalogIn/code.py b/Introducing_Gemma_M0/Gemma_AnalogIn/code.py index f4059ba25..82ce63009 100644 --- a/Introducing_Gemma_M0/Gemma_AnalogIn/code.py +++ b/Introducing_Gemma_M0/Gemma_AnalogIn/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # Gemma IO demo - analog inputs import time diff --git a/Introducing_Gemma_M0/Gemma_AnalogOut/code.py b/Introducing_Gemma_M0/Gemma_AnalogOut/code.py index 85f307a63..afa9bb2fc 100644 --- a/Introducing_Gemma_M0/Gemma_AnalogOut/code.py +++ b/Introducing_Gemma_M0/Gemma_AnalogOut/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # CircuitPython IO demo - analog output import board diff --git a/Introducing_Gemma_M0/Gemma_CapTouch/code.py b/Introducing_Gemma_M0/Gemma_CapTouch/code.py index 98c9dc8b3..5376bde5e 100644 --- a/Introducing_Gemma_M0/Gemma_CapTouch/code.py +++ b/Introducing_Gemma_M0/Gemma_CapTouch/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # Gemma IO demo - captouch import time diff --git a/Introducing_Gemma_M0/Gemma_DigitalIO/code.py b/Introducing_Gemma_M0/Gemma_DigitalIO/code.py index 5eefbb63c..664c56754 100644 --- a/Introducing_Gemma_M0/Gemma_DigitalIO/code.py +++ b/Introducing_Gemma_M0/Gemma_DigitalIO/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # CircuitPython IO demo #1 - General Purpose I/O import time diff --git a/Introducing_Gemma_M0/Gemma_DotStar/code.py b/Introducing_Gemma_M0/Gemma_DotStar/code.py index 69d463c3a..3c39bbfb3 100644 --- a/Introducing_Gemma_M0/Gemma_DotStar/code.py +++ b/Introducing_Gemma_M0/Gemma_DotStar/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # CircuitPython demo - Dotstar import time diff --git a/Introducing_Gemma_M0/Gemma_HIDkeyboard/code.py b/Introducing_Gemma_M0/Gemma_HIDkeyboard/code.py index f03064c25..16bcce4a2 100644 --- a/Introducing_Gemma_M0/Gemma_HIDkeyboard/code.py +++ b/Introducing_Gemma_M0/Gemma_HIDkeyboard/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # CircuitPlayground demo - Keyboard emu import time diff --git a/Introducing_Gemma_M0/Gemma_I2CScan/code.py b/Introducing_Gemma_M0/Gemma_I2CScan/code.py index 63b65375e..f49e9f028 100644 --- a/Introducing_Gemma_M0/Gemma_I2CScan/code.py +++ b/Introducing_Gemma_M0/Gemma_I2CScan/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # Gemma/Trinket IO demo - I2C scan import time diff --git a/Introducing_Gemma_M0/Gemma_I2Csi7021/code.py b/Introducing_Gemma_M0/Gemma_I2Csi7021/code.py index ff4e7121a..1f708c547 100644 --- a/Introducing_Gemma_M0/Gemma_I2Csi7021/code.py +++ b/Introducing_Gemma_M0/Gemma_I2Csi7021/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # I2C sensor demo import time diff --git a/Introducing_Gemma_M0/Gemma_Logger/code.py b/Introducing_Gemma_M0/Gemma_Logger/code.py index fe43400d7..7c50f241d 100644 --- a/Introducing_Gemma_M0/Gemma_Logger/code.py +++ b/Introducing_Gemma_M0/Gemma_Logger/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import time import board diff --git a/Introducing_Gemma_M0/Gemma_Logger_boot/code.py b/Introducing_Gemma_M0/Gemma_Logger_boot/code.py index 10d73a6e7..f21a6e571 100644 --- a/Introducing_Gemma_M0/Gemma_Logger_boot/code.py +++ b/Introducing_Gemma_M0/Gemma_Logger_boot/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import board import digitalio import storage diff --git a/Introducing_Gemma_M0/Gemma_NeoPixel/code.py b/Introducing_Gemma_M0/Gemma_NeoPixel/code.py index a6cf48ba8..b1170c7d4 100644 --- a/Introducing_Gemma_M0/Gemma_NeoPixel/code.py +++ b/Introducing_Gemma_M0/Gemma_NeoPixel/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # CircuitPython demo - NeoPixel import time diff --git a/Introducing_Gemma_M0/Gemma_Touch_DotStar/code.py b/Introducing_Gemma_M0/Gemma_Touch_DotStar/code.py index 070099581..54ba3bc80 100644 --- a/Introducing_Gemma_M0/Gemma_Touch_DotStar/code.py +++ b/Introducing_Gemma_M0/Gemma_Touch_DotStar/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # Gemma IO demo - captouch to dotstar import time diff --git a/Introducing_Gemma_M0/Gemma_UART/code.py b/Introducing_Gemma_M0/Gemma_UART/code.py index 64be6153a..c6af683ca 100644 --- a/Introducing_Gemma_M0/Gemma_UART/code.py +++ b/Introducing_Gemma_M0/Gemma_UART/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # Gemma IO demo - USB/Serial echo import busio diff --git a/Introducing_Gemma_M0/dht22/code.py b/Introducing_Gemma_M0/dht22/code.py index d25b585d7..7b34ef652 100644 --- a/Introducing_Gemma_M0/dht22/code.py +++ b/Introducing_Gemma_M0/dht22/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import time import adafruit_dht diff --git a/Introducing_Gemma_M0/piezo_manual/code.py b/Introducing_Gemma_M0/piezo_manual/code.py index 1aa905871..ae1963bb9 100644 --- a/Introducing_Gemma_M0/piezo_manual/code.py +++ b/Introducing_Gemma_M0/piezo_manual/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import time import board diff --git a/Introducing_Gemma_M0/piezo_simpleio/code.py b/Introducing_Gemma_M0/piezo_simpleio/code.py index b09657d2e..d3aede9e2 100644 --- a/Introducing_Gemma_M0/piezo_simpleio/code.py +++ b/Introducing_Gemma_M0/piezo_simpleio/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import time import board diff --git a/Introducing_Gemma_M0/servosweep/code.py b/Introducing_Gemma_M0/servosweep/code.py index 7f9a5c1cd..1b7496f6f 100644 --- a/Introducing_Gemma_M0/servosweep/code.py +++ b/Introducing_Gemma_M0/servosweep/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import time import board diff --git a/IoT_NeoPixel_Sign/code.py b/IoT_NeoPixel_Sign/code.py index c9f8a3034..3c0130464 100644 --- a/IoT_NeoPixel_Sign/code.py +++ b/IoT_NeoPixel_Sign/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Noe Ruiz for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import ssl import board import neopixel diff --git a/LED_Trampoline/code.py b/LED_Trampoline/code.py index cf78455ea..5b5d28c87 100644 --- a/LED_Trampoline/code.py +++ b/LED_Trampoline/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import random import time diff --git a/Make_It_Twist_Potentiometer/potentiometer-neopixels/code.py b/Make_It_Twist_Potentiometer/potentiometer-neopixels/code.py index 22ac840b9..8dbf7d05d 100644 --- a/Make_It_Twist_Potentiometer/potentiometer-neopixels/code.py +++ b/Make_It_Twist_Potentiometer/potentiometer-neopixels/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Anne Barela for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import time import board from analogio import AnalogIn diff --git a/Make_It_Twist_Potentiometer/potentiometer-neopixels/potentiometer-neopixels.ino b/Make_It_Twist_Potentiometer/potentiometer-neopixels/potentiometer-neopixels.ino index f92e7a1e3..cf219baf0 100644 --- a/Make_It_Twist_Potentiometer/potentiometer-neopixels/potentiometer-neopixels.ino +++ b/Make_It_Twist_Potentiometer/potentiometer-neopixels/potentiometer-neopixels.ino @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2018 Anne Barela for Adafruit Industries +// +// SPDX-License-Identifier: MIT + // Read analog potentiometer on Circuit Playground Express or other board with changes // Anne Barela for Adafruit Industries 9/2018 based on // NeoPixel Ring simple sketch (c) 2013 Shae Erisson diff --git a/Make_It_Twist_Potentiometer/potentiometer-print/code.py b/Make_It_Twist_Potentiometer/potentiometer-print/code.py index 3f72dd292..6cfc01c7d 100644 --- a/Make_It_Twist_Potentiometer/potentiometer-print/code.py +++ b/Make_It_Twist_Potentiometer/potentiometer-print/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Anne Barela for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import time import board from analogio import AnalogIn diff --git a/NeoPixel_Tiara/NeoPixel_Tiara.ino b/NeoPixel_Tiara/NeoPixel_Tiara.ino index 8f8300345..12c68d419 100644 --- a/NeoPixel_Tiara/NeoPixel_Tiara.ino +++ b/NeoPixel_Tiara/NeoPixel_Tiara.ino @@ -1,3 +1,8 @@ +// SPDX-FileCopyrightText: 2017 Dano Wall for Adafruit Industries +// SPDX-FileCopyrightText: 2017 Becky Stern for Adafruit Industries +// +// SPDX-License-Identifier: MIT + //Random Flash animation for Neopixel circuits //by Dano Wall and Becky Stern for Adafruit Industries //based on the Sparkle Skirt, minus the accelerometer diff --git a/PyBadge_Blinka_Jump_Game/code.py b/PyBadge_Blinka_Jump_Game/code.py index c0b68a8a0..5d18b67df 100644 --- a/PyBadge_Blinka_Jump_Game/code.py +++ b/PyBadge_Blinka_Jump_Game/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Liz Clark for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import time from random import randint from micropython import const diff --git a/Sunflower_Mobile/code.py b/Sunflower_Mobile/code.py index fa815fcfb..7dd2cbbd2 100644 --- a/Sunflower_Mobile/code.py +++ b/Sunflower_Mobile/code.py @@ -1,3 +1,8 @@ +# SPDX-FileCopyrightText: 2021 Erin St Blaine for Adafruit Industries +# SPDX-FileCopyrightText: 2021 Dan Halbert for Adafruit Industries +# +# SPDX-License-Identifier: MIT + """ LED Sunflower Mobile with Circuit Playground Bluefruit Full tutorial: