diff --git a/CircuitPython_Quick_Starts/CircuitPython_AnalogIn/code.py b/CircuitPython_Quick_Starts/CircuitPython_AnalogIn/code.py index 4a1418ed..49439e32 100644 --- a/CircuitPython_Quick_Starts/CircuitPython_AnalogIn/code.py +++ b/CircuitPython_Quick_Starts/CircuitPython_AnalogIn/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # CircuitPython AnalogIn Demo import time diff --git a/CircuitPython_Quick_Starts/CircuitPython_AnalogOut/code.py b/CircuitPython_Quick_Starts/CircuitPython_AnalogOut/code.py index 43f74338..636bed62 100644 --- a/CircuitPython_Quick_Starts/CircuitPython_AnalogOut/code.py +++ b/CircuitPython_Quick_Starts/CircuitPython_AnalogOut/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # CircuitPython IO demo - analog output import board diff --git a/CircuitPython_Quick_Starts/CircuitPython_Digital_In_Out/code.py b/CircuitPython_Quick_Starts/CircuitPython_Digital_In_Out/code.py index e3e96740..5446d817 100644 --- a/CircuitPython_Quick_Starts/CircuitPython_Digital_In_Out/code.py +++ b/CircuitPython_Quick_Starts/CircuitPython_Digital_In_Out/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # CircuitPython IO demo #1 - General Purpose I/O import time diff --git a/CircuitPython_Quick_Starts/CircuitPython_DotStar/code.py b/CircuitPython_Quick_Starts/CircuitPython_DotStar/code.py index d25237dc..eb36d668 100644 --- a/CircuitPython_Quick_Starts/CircuitPython_DotStar/code.py +++ b/CircuitPython_Quick_Starts/CircuitPython_DotStar/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # CircuitPython demo - Dotstar import time diff --git a/CircuitPython_Quick_Starts/CircuitPython_Internal_RGB_LED_colors/code.py b/CircuitPython_Quick_Starts/CircuitPython_Internal_RGB_LED_colors/code.py index a60f0a0a..367b9b09 100644 --- a/CircuitPython_Quick_Starts/CircuitPython_Internal_RGB_LED_colors/code.py +++ b/CircuitPython_Quick_Starts/CircuitPython_Internal_RGB_LED_colors/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import time import adafruit_dotstar diff --git a/CircuitPython_Quick_Starts/CircuitPython_NeoPixel/code.py b/CircuitPython_Quick_Starts/CircuitPython_NeoPixel/code.py index db3ae747..babe9a35 100644 --- a/CircuitPython_Quick_Starts/CircuitPython_NeoPixel/code.py +++ b/CircuitPython_Quick_Starts/CircuitPython_NeoPixel/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # CircuitPython demo - NeoPixel import time diff --git a/CircuitPython_Quick_Starts/CircuitPython_NeoPixel_RGBW/code.py b/CircuitPython_Quick_Starts/CircuitPython_NeoPixel_RGBW/code.py index d6c1604f..d468f5c1 100644 --- a/CircuitPython_Quick_Starts/CircuitPython_NeoPixel_RGBW/code.py +++ b/CircuitPython_Quick_Starts/CircuitPython_NeoPixel_RGBW/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # CircuitPython demo - NeoPixel RGBW import time diff --git a/CircuitPython_Quick_Starts/CircuitPython_PWM/code.py b/CircuitPython_Quick_Starts/CircuitPython_PWM/code.py index 1f6d4f1a..434f6caf 100644 --- a/CircuitPython_Quick_Starts/CircuitPython_PWM/code.py +++ b/CircuitPython_Quick_Starts/CircuitPython_PWM/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import time import board diff --git a/CircuitPython_Quick_Starts/CircuitPython_PWM_Piezo/code.py b/CircuitPython_Quick_Starts/CircuitPython_PWM_Piezo/code.py index c0d7edf6..ce1e3097 100644 --- a/CircuitPython_Quick_Starts/CircuitPython_PWM_Piezo/code.py +++ b/CircuitPython_Quick_Starts/CircuitPython_PWM_Piezo/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import time import board diff --git a/CircuitPython_Quick_Starts/CircuitPython_PWM_Piezo_simpleio/code.py b/CircuitPython_Quick_Starts/CircuitPython_PWM_Piezo_simpleio/code.py index bc14792e..57c1097d 100644 --- a/CircuitPython_Quick_Starts/CircuitPython_PWM_Piezo_simpleio/code.py +++ b/CircuitPython_Quick_Starts/CircuitPython_PWM_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/CircuitPython_Quick_Starts/PWM_Test_Script/code.py b/CircuitPython_Quick_Starts/PWM_Test_Script/code.py index cc109db5..073c4930 100644 --- a/CircuitPython_Quick_Starts/PWM_Test_Script/code.py +++ b/CircuitPython_Quick_Starts/PWM_Test_Script/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import board import pwmio diff --git a/CircuitPython_Quick_Starts/SPI_Test_Script/code.py b/CircuitPython_Quick_Starts/SPI_Test_Script/code.py index 26969fe0..c33a857b 100644 --- a/CircuitPython_Quick_Starts/SPI_Test_Script/code.py +++ b/CircuitPython_Quick_Starts/SPI_Test_Script/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import board import busio diff --git a/CircuitPython_Quick_Starts/UART_Test_Script/code.py b/CircuitPython_Quick_Starts/UART_Test_Script/code.py index 5cd6c6aa..770361df 100644 --- a/CircuitPython_Quick_Starts/UART_Test_Script/code.py +++ b/CircuitPython_Quick_Starts/UART_Test_Script/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import board import busio diff --git a/LED_Ampli_Tie/Ampli_Tie_Adjustable/Ampli_Tie_Adjustable.ino b/LED_Ampli_Tie/Ampli_Tie_Adjustable/Ampli_Tie_Adjustable.ino index 79255822..cf482aa6 100644 --- a/LED_Ampli_Tie/Ampli_Tie_Adjustable/Ampli_Tie_Adjustable.ino +++ b/LED_Ampli_Tie/Ampli_Tie_Adjustable/Ampli_Tie_Adjustable.ino @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2017 Mikey Sklar for Adafruit Industries +// +// SPDX-License-Identifier: MIT + /* LED VU meter for Arduino and Adafruit NeoPixel LEDs. More info: http://learn.adafruit.com/led-ampli-tie/ diff --git a/LED_Ampli_Tie/Ampli_Tie_Dynamic/Ampli_Tie_Dynamic.ino b/LED_Ampli_Tie/Ampli_Tie_Dynamic/Ampli_Tie_Dynamic.ino index 2d616722..c9e83c3e 100644 --- a/LED_Ampli_Tie/Ampli_Tie_Dynamic/Ampli_Tie_Dynamic.ino +++ b/LED_Ampli_Tie/Ampli_Tie_Dynamic/Ampli_Tie_Dynamic.ino @@ -1,3 +1,8 @@ +// SPDX-FileCopyrightText: 2017 Mikey Sklar for Adafruit Industries +// SPDX-FileCopyrightText: 2019 Anne Barela for Adafruit Industries +// +// SPDX-License-Identifier: MIT + /* LED VU meter for Arduino and Adafruit NeoPixel LEDs. More info: http://learn.adafruit.com/led-ampli-tie/ diff --git a/Make_It_Glow_With_Crickit/CPX-NeoPixels/code.py b/Make_It_Glow_With_Crickit/CPX-NeoPixels/code.py index 0edc55bb..7ed9cc4f 100644 --- a/Make_It_Glow_With_Crickit/CPX-NeoPixels/code.py +++ b/Make_It_Glow_With_Crickit/CPX-NeoPixels/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Anne Barela for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # Use the 10 NeoPixels on Circuit Playground Express via the # Adafruit neopixel library import time diff --git a/Make_It_Glow_With_Crickit/Crickit-CPX-NeoPixels/code.py b/Make_It_Glow_With_Crickit/Crickit-CPX-NeoPixels/code.py index 489cb7b0..944f2606 100644 --- a/Make_It_Glow_With_Crickit/Crickit-CPX-NeoPixels/code.py +++ b/Make_It_Glow_With_Crickit/Crickit-CPX-NeoPixels/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # Drive NeoPixels on the NeoPixels Block on Crickit for # Circuit Playground Express import time diff --git a/Make_It_Glow_With_Crickit/Crickit-Feather-NeoPixels/code.py b/Make_It_Glow_With_Crickit/Crickit-Feather-NeoPixels/code.py index 617d42d2..d839f3ac 100644 --- a/Make_It_Glow_With_Crickit/Crickit-Feather-NeoPixels/code.py +++ b/Make_It_Glow_With_Crickit/Crickit-Feather-NeoPixels/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # Drive NeoPixels on the NeoPixels Block on Crickit FeatherWing import time from rainbowio import colorwheel diff --git a/Make_It_Glow_With_Crickit/Crickit-Onboard-NeoPixel/code.py b/Make_It_Glow_With_Crickit/Crickit-Onboard-NeoPixel/code.py index 77666993..11464710 100644 --- a/Make_It_Glow_With_Crickit/Crickit-Onboard-NeoPixel/code.py +++ b/Make_It_Glow_With_Crickit/Crickit-Onboard-NeoPixel/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018 Anne Barela for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # Using Crickit's onboard NeoPixel # See http://www.color-hex.com/ for more colors and find your fav! from adafruit_crickit import crickit diff --git a/PyPortal_Bitcoin/bitcoin/code.py b/PyPortal_Bitcoin/bitcoin/code.py index 71ccff84..c9526590 100644 --- a/PyPortal_Bitcoin/bitcoin/code.py +++ b/PyPortal_Bitcoin/bitcoin/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2019 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + """ This example will access the coindesk API, grab a number like bitcoin value in USD and display it on a screen diff --git a/PyPortal_Bitcoin/bitcoin_2/code.py b/PyPortal_Bitcoin/bitcoin_2/code.py index 0828d3d7..a0e124ec 100644 --- a/PyPortal_Bitcoin/bitcoin_2/code.py +++ b/PyPortal_Bitcoin/bitcoin_2/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2019 Limor Fried for Adafruit Industries +# +# SPDX-License-Identifier: MIT + """ This example will access the coindesk API, grab a number like bitcoin value in USD, multiply it by your # of bitcoins and display it on a screen diff --git a/PyPortal_CMA_Art_Frame/code.py b/PyPortal_CMA_Art_Frame/code.py index 1c5df523..6fe4a194 100644 --- a/PyPortal_CMA_Art_Frame/code.py +++ b/PyPortal_CMA_Art_Frame/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Dan Cogliano for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import time import random import board diff --git a/PyPortal_CMA_Art_Frame/secrets.py b/PyPortal_CMA_Art_Frame/secrets.py index be8c8246..64c59aac 100644 --- a/PyPortal_CMA_Art_Frame/secrets.py +++ b/PyPortal_CMA_Art_Frame/secrets.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + # This file is where you keep secret settings, passwords, and tokens! # If you put them in the code you risk committing that info or sharing it diff --git a/Slider_Trinkey/Arduino_Slider_Trinkey_Demo/Arduino_Slider_Trinkey_Demo.ino b/Slider_Trinkey/Arduino_Slider_Trinkey_Demo/Arduino_Slider_Trinkey_Demo.ino index b1c052a1..0586cfec 100644 --- a/Slider_Trinkey/Arduino_Slider_Trinkey_Demo/Arduino_Slider_Trinkey_Demo.ino +++ b/Slider_Trinkey/Arduino_Slider_Trinkey_Demo/Arduino_Slider_Trinkey_Demo.ino @@ -1,65 +1,69 @@ -#include -#include "Adafruit_FreeTouch.h" - -// Create the neopixel strip with the built in definitions NUM_NEOPIXEL and PIN_NEOPIXEL -Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_NEOPIXEL, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800); -// Create the touch pad -Adafruit_FreeTouch qt = Adafruit_FreeTouch(PIN_TOUCH, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE); - -int16_t neo_brightness = 255; // initialize with highest brightness - -void setup() { - Serial.begin(9600); - //while (!Serial); - - strip.begin(); - strip.setBrightness(neo_brightness); - strip.show(); // Initialize all pixels to 'off' - - analogReadResolution(12); // set highest resolution - - if (! qt.begin()) - Serial.println("Failed to begin qt"); -} - -void loop() { - uint16_t touch = qt.measure(); - Serial.print("Touch: "); Serial.println(touch); - - uint16_t potval = analogRead(PIN_POTENTIOMETER); - Serial.print("Slider: "); - Serial.println((float)potval / 4095); - - uint8_t wheelval = map(potval, 0, 4095, 0, 255); - //Serial.print("Wheel: "); - //Serial.println(wheelval); - - // If the pad is touched, turn off neopix! - if (touch > 500) { - Serial.println("Touched!"); - strip.setBrightness(0); - } else { - strip.setBrightness(255); - } - - for(int i=0; i< strip.numPixels(); i++) { - strip.setPixelColor(i, Wheel((wheelval+85) % 255)); - } - - strip.show(); - delay(10); -} - -// Input a value 0 to 255 to get a color value. -// The colours are a transition r - g - b - back to r. -uint32_t Wheel(byte WheelPos) { - if(WheelPos < 85) { - return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0); - } else if(WheelPos < 170) { - WheelPos -= 85; - return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); - } else { - WheelPos -= 170; - return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3); - } -} +// SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries +// +// SPDX-License-Identifier: MIT + +#include +#include "Adafruit_FreeTouch.h" + +// Create the neopixel strip with the built in definitions NUM_NEOPIXEL and PIN_NEOPIXEL +Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_NEOPIXEL, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800); +// Create the touch pad +Adafruit_FreeTouch qt = Adafruit_FreeTouch(PIN_TOUCH, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE); + +int16_t neo_brightness = 255; // initialize with highest brightness + +void setup() { + Serial.begin(9600); + //while (!Serial); + + strip.begin(); + strip.setBrightness(neo_brightness); + strip.show(); // Initialize all pixels to 'off' + + analogReadResolution(12); // set highest resolution + + if (! qt.begin()) + Serial.println("Failed to begin qt"); +} + +void loop() { + uint16_t touch = qt.measure(); + Serial.print("Touch: "); Serial.println(touch); + + uint16_t potval = analogRead(PIN_POTENTIOMETER); + Serial.print("Slider: "); + Serial.println((float)potval / 4095); + + uint8_t wheelval = map(potval, 0, 4095, 0, 255); + //Serial.print("Wheel: "); + //Serial.println(wheelval); + + // If the pad is touched, turn off neopix! + if (touch > 500) { + Serial.println("Touched!"); + strip.setBrightness(0); + } else { + strip.setBrightness(255); + } + + for(int i=0; i< strip.numPixels(); i++) { + strip.setPixelColor(i, Wheel((wheelval+85) % 255)); + } + + strip.show(); + delay(10); +} + +// Input a value 0 to 255 to get a color value. +// The colours are a transition r - g - b - back to r. +uint32_t Wheel(byte WheelPos) { + if(WheelPos < 85) { + return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0); + } else if(WheelPos < 170) { + WheelPos -= 85; + return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); + } else { + WheelPos -= 170; + return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3); + } +} diff --git a/Slider_Trinkey/Capacitive_Touch/code.py b/Slider_Trinkey/Capacitive_Touch/code.py index 20f995d4..9045702a 100644 --- a/Slider_Trinkey/Capacitive_Touch/code.py +++ b/Slider_Trinkey/Capacitive_Touch/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + """CircuitPython capacitive touch example for Slider Trinkey""" import time import board diff --git a/Slider_Trinkey/Hue_Brightness_Python_Code/Hue_Brightness_Python_code.py b/Slider_Trinkey/Hue_Brightness_Python_Code/Hue_Brightness_Python_code.py index 10b64fb4..f72ac0be 100644 --- a/Slider_Trinkey/Hue_Brightness_Python_Code/Hue_Brightness_Python_code.py +++ b/Slider_Trinkey/Hue_Brightness_Python_Code/Hue_Brightness_Python_code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + """ Slider Trinkey Hue Brightness Python Example (Requires Hue and Monitor Brightness CircuitPython example to be running on the Slider Trinkey) diff --git a/Slider_Trinkey/Hue_and_Monitor_Brightness_CircuitPython_Code/code.py b/Slider_Trinkey/Hue_and_Monitor_Brightness_CircuitPython_Code/code.py index 9e1872be..1eb4fc06 100644 --- a/Slider_Trinkey/Hue_and_Monitor_Brightness_CircuitPython_Code/code.py +++ b/Slider_Trinkey/Hue_and_Monitor_Brightness_CircuitPython_Code/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import time import board from analogio import AnalogIn diff --git a/Slider_Trinkey/MIDI_CC_Cross_Fader/code.py b/Slider_Trinkey/MIDI_CC_Cross_Fader/code.py index d827edec..d0408b97 100644 --- a/Slider_Trinkey/MIDI_CC_Cross_Fader/code.py +++ b/Slider_Trinkey/MIDI_CC_Cross_Fader/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + import time import board import analogio diff --git a/Slider_Trinkey/Monitor_Brightness_Python_Code/Montor_Brightness_Python_code.py b/Slider_Trinkey/Monitor_Brightness_Python_Code/Montor_Brightness_Python_code.py index 90dbb071..aeb8a37f 100644 --- a/Slider_Trinkey/Monitor_Brightness_Python_Code/Montor_Brightness_Python_code.py +++ b/Slider_Trinkey/Monitor_Brightness_Python_Code/Montor_Brightness_Python_code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + """ Slider Trinkey Monitor Brightness Demo for Windows (Requires Hue and Monitor Brightness CircuitPython example to be running on the Slider Trinkey) diff --git a/Slider_Trinkey/NeoPixel_Blink/code.py b/Slider_Trinkey/NeoPixel_Blink/code.py index 1be61f90..2bb3a33e 100644 --- a/Slider_Trinkey/NeoPixel_Blink/code.py +++ b/Slider_Trinkey/NeoPixel_Blink/code.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: MIT + """CircuitPython NeoPixel Blink Example for Slider Trinkey""" import time import board