Merge pull request #2048 from adafruit/spdx-25
Added SPDX to 30 more files - spdx-25
This commit is contained in:
commit
1fe33bcefa
30 changed files with 186 additions and 65 deletions
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# CircuitPython AnalogIn Demo
|
||||
|
||||
import time
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# CircuitPython IO demo - analog output
|
||||
|
||||
import board
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# CircuitPython demo - Dotstar
|
||||
|
||||
import time
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import time
|
||||
|
||||
import adafruit_dotstar
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# CircuitPython demo - NeoPixel
|
||||
|
||||
import time
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# CircuitPython demo - NeoPixel RGBW
|
||||
|
||||
import time
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import time
|
||||
|
||||
import board
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import time
|
||||
|
||||
import board
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import time
|
||||
|
||||
import board
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import board
|
||||
import pwmio
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import board
|
||||
import busio
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import board
|
||||
import busio
|
||||
|
||||
|
|
|
|||
|
|
@ -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/
|
||||
|
||||
|
|
|
|||
|
|
@ -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/
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2020 Dan Cogliano for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import time
|
||||
import random
|
||||
import board
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -1,65 +1,69 @@
|
|||
#include <Adafruit_NeoPixel.h>
|
||||
#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 <Adafruit_NeoPixel.h>
|
||||
#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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import time
|
||||
import board
|
||||
from analogio import AnalogIn
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import time
|
||||
import board
|
||||
import analogio
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue