Added SPDX to 30 more files - spdx-31
This commit is contained in:
parent
bfe5427a4a
commit
941a9baa3c
30 changed files with 226 additions and 106 deletions
|
|
@ -1,3 +1,7 @@
|
|||
// SPDX-FileCopyrightText: 2015 Hristo Gochkov
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/*
|
||||
TFT SPI Flash Server - Example WebServer with internal SPI flash storage
|
||||
for Adafruit ESP32-S2 TFT Feather
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
CircuitPython Capacitive Touch Pad Example - Print to the serial console when one pad is touched.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
CircuitPython Capacitive Two Touch Pad Example - Print to the serial console when a pad is touched.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
CircuitPython NeoPixel Blink example - blinking the built-in NeoPixels.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
NeoPixel brightness proximity example. Increases the brightness of the NeoPixels as you move closer
|
||||
to the proximity sensor.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
Proximity spacebar dino game example. Sends a space when you move your hand close to the proximity
|
||||
sensor and turns the LEDs on to let you know you're in the right range. For use with the Chrome
|
||||
|
|
|
|||
|
|
@ -1,106 +1,110 @@
|
|||
#include <Adafruit_NeoPixel.h>
|
||||
#include "Adafruit_FreeTouch.h"
|
||||
#include "Adafruit_APDS9960.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);
|
||||
int16_t neo_brightness = 20; // initialize with 20 brightness (out of 255)
|
||||
|
||||
// Create the two touch pads on pins 1 and 2:
|
||||
Adafruit_FreeTouch qt_1 = Adafruit_FreeTouch(1, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE);
|
||||
Adafruit_FreeTouch qt_2 = Adafruit_FreeTouch(2, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE);
|
||||
|
||||
Adafruit_APDS9960 apds;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
//while (!Serial);
|
||||
|
||||
strip.begin();
|
||||
strip.setBrightness(neo_brightness);
|
||||
strip.show(); // Initialize all pixels to 'off'
|
||||
|
||||
if (! qt_1.begin())
|
||||
Serial.println("Failed to begin qt on pin 1");
|
||||
if (! qt_2.begin())
|
||||
Serial.println("Failed to begin qt on pin 2");
|
||||
|
||||
pinMode(PIN_INTERRUPT, INPUT_PULLUP);
|
||||
if(!apds.begin()){
|
||||
Serial.println("failed to initialize device! Please check your wiring.");
|
||||
while (1) {
|
||||
strip.fill(0xFF0000);
|
||||
strip.show();
|
||||
delay(100);
|
||||
strip.fill(0x00);
|
||||
strip.show();
|
||||
delay(100);
|
||||
}
|
||||
}
|
||||
|
||||
Serial.println("APDS initialized!");
|
||||
apds.enableProximity(true);
|
||||
apds.setProxGain(APDS9960_PGAIN_8X);
|
||||
apds.setLED(APDS9960_LEDDRIVE_100MA, APDS9960_LEDBOOST_300PCNT);
|
||||
apds.setProxPulse(APDS9960_PPULSELEN_16US, 1);
|
||||
|
||||
//set the interrupt threshold to fire when proximity reading goes above 2
|
||||
apds.setProximityInterruptThreshold(0, 2);
|
||||
apds.enableProximityInterrupt();
|
||||
}
|
||||
|
||||
uint8_t j=0;
|
||||
|
||||
void loop() {
|
||||
|
||||
// print the proximity reading when the interrupt pin goes low
|
||||
if (!digitalRead(PIN_INTERRUPT)){
|
||||
uint16_t prox = apds.readProximity();
|
||||
Serial.print("Proximity: ");
|
||||
Serial.println(prox);
|
||||
|
||||
if (prox < 3) prox = 0; // ignore 1 and 2 readings
|
||||
strip.setBrightness(prox);
|
||||
|
||||
//clear the interrupt
|
||||
apds.clearInterrupt();
|
||||
} else {
|
||||
strip.setBrightness(0);
|
||||
}
|
||||
|
||||
strip.fill(Wheel(j));
|
||||
strip.show();
|
||||
|
||||
// measure the captouches
|
||||
uint16_t touch1 = qt_1.measure();
|
||||
uint16_t touch2 = qt_2.measure();
|
||||
|
||||
// If the first pad is touched, go forward
|
||||
if (touch1 > 500) {
|
||||
Serial.println("QT 1 touched");
|
||||
j++;
|
||||
}
|
||||
|
||||
// If the second pad is touched, go backward
|
||||
if (touch2 > 500) {
|
||||
Serial.println("QT 2 touched");
|
||||
j--;
|
||||
}
|
||||
|
||||
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"
|
||||
#include "Adafruit_APDS9960.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);
|
||||
int16_t neo_brightness = 20; // initialize with 20 brightness (out of 255)
|
||||
|
||||
// Create the two touch pads on pins 1 and 2:
|
||||
Adafruit_FreeTouch qt_1 = Adafruit_FreeTouch(1, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE);
|
||||
Adafruit_FreeTouch qt_2 = Adafruit_FreeTouch(2, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE);
|
||||
|
||||
Adafruit_APDS9960 apds;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
//while (!Serial);
|
||||
|
||||
strip.begin();
|
||||
strip.setBrightness(neo_brightness);
|
||||
strip.show(); // Initialize all pixels to 'off'
|
||||
|
||||
if (! qt_1.begin())
|
||||
Serial.println("Failed to begin qt on pin 1");
|
||||
if (! qt_2.begin())
|
||||
Serial.println("Failed to begin qt on pin 2");
|
||||
|
||||
pinMode(PIN_INTERRUPT, INPUT_PULLUP);
|
||||
if(!apds.begin()){
|
||||
Serial.println("failed to initialize device! Please check your wiring.");
|
||||
while (1) {
|
||||
strip.fill(0xFF0000);
|
||||
strip.show();
|
||||
delay(100);
|
||||
strip.fill(0x00);
|
||||
strip.show();
|
||||
delay(100);
|
||||
}
|
||||
}
|
||||
|
||||
Serial.println("APDS initialized!");
|
||||
apds.enableProximity(true);
|
||||
apds.setProxGain(APDS9960_PGAIN_8X);
|
||||
apds.setLED(APDS9960_LEDDRIVE_100MA, APDS9960_LEDBOOST_300PCNT);
|
||||
apds.setProxPulse(APDS9960_PPULSELEN_16US, 1);
|
||||
|
||||
//set the interrupt threshold to fire when proximity reading goes above 2
|
||||
apds.setProximityInterruptThreshold(0, 2);
|
||||
apds.enableProximityInterrupt();
|
||||
}
|
||||
|
||||
uint8_t j=0;
|
||||
|
||||
void loop() {
|
||||
|
||||
// print the proximity reading when the interrupt pin goes low
|
||||
if (!digitalRead(PIN_INTERRUPT)){
|
||||
uint16_t prox = apds.readProximity();
|
||||
Serial.print("Proximity: ");
|
||||
Serial.println(prox);
|
||||
|
||||
if (prox < 3) prox = 0; // ignore 1 and 2 readings
|
||||
strip.setBrightness(prox);
|
||||
|
||||
//clear the interrupt
|
||||
apds.clearInterrupt();
|
||||
} else {
|
||||
strip.setBrightness(0);
|
||||
}
|
||||
|
||||
strip.fill(Wheel(j));
|
||||
strip.show();
|
||||
|
||||
// measure the captouches
|
||||
uint16_t touch1 = qt_1.measure();
|
||||
uint16_t touch2 = qt_2.measure();
|
||||
|
||||
// If the first pad is touched, go forward
|
||||
if (touch1 > 500) {
|
||||
Serial.println("QT 1 touched");
|
||||
j++;
|
||||
}
|
||||
|
||||
// If the second pad is touched, go backward
|
||||
if (touch2 > 500) {
|
||||
Serial.println("QT 2 touched");
|
||||
j--;
|
||||
}
|
||||
|
||||
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: 2018 Anne Barela for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# Blues Playground Instrument
|
||||
# 2018-06-19 v03
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2018 Mikey Sklar for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import time
|
||||
|
||||
import adafruit_CCS811
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2020 John Park for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# Bonsai Buckaroo + CLUE Plant Care Bot
|
||||
|
||||
import time
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2019 Liz Clark for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import random
|
||||
import board
|
||||
import neopixel
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2021 Liz Clark for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
Prop-Maker based Darksaber
|
||||
Adapted from the Prop-Maker based Master Sword code
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2018 Isaac Wellish for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# Author: Isaac Wellish
|
||||
# Code adapted from Tony Dicola's CircuitPython code using the DS18x20 temp sensor
|
||||
# as well as John Park's CircuitPython code determining soil moisture from nails
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2020 Andy Doro for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# AUTOCHEER DEVICE
|
||||
# code by Andy Doro
|
||||
#
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// SPDX-FileCopyrightText: 2020 Andy Doro for Adafruit Industries
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/*
|
||||
AUTOCHEER DEVICE
|
||||
---
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2019 Dave Astels for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
IoT environmental sensor node.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2019 Dave Astels for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
IoT environmental sensor node.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2019 Dave Astels for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
IoT environmental sensor node.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2019 Dave Astels for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
IoT environmental sensor node.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2019 Dave Astels 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,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2020 John Park for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# MP3 playback with tap trigger
|
||||
# Works on Feather M4 (or other M4 based boards) with Propmaker
|
||||
import time
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2020 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import board
|
||||
import digitalio
|
||||
import neopixel
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2020 John Park for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# ON AIR sign for YouTube livestreaming
|
||||
# Runs on Airlift Metro M4 with 64x32 RGB Matrix display & shield
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2020 John Park for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# Metro Matrix Clock
|
||||
# Runs on Airlift Metro M4 with 64x32 RGB Matrix display & shield
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// SPDX-FileCopyrightText: 2018 Erin St Blaine for Adafruit Industries
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
// Code by Erin St. Blaine for Adafruit Industries
|
||||
// NeoPixel Aquarium Tutorial: https://learn.adafruit.com/neopixel-aquarium-with-submersible-lights/
|
||||
// For QT Py board
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2019 Melissa LeBlanc-Williams for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
This is a Conference Badge type Name Tag that is intended to be displayed on
|
||||
the PyBadge. Feel free to customize it to your heart's content.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
|
||||
#define N_PIXELS 12 // Number of pixels you are using
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import array
|
||||
from rainbowio import colorwheel
|
||||
import board
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// SPDX-FileCopyrightText: 2019 Melissa LeBlanc-Williams for Adafruit Industries
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
// Message Panel
|
||||
// Reads an Adafruit IO Feed, then formats and displays the message
|
||||
// Author: Melissa LeBlanc-Williams
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// SPDX-FileCopyrightText: 2019 Melissa LeBlanc-Williams for Adafruit Industries
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/************************ Adafruit IO Config *******************************/
|
||||
|
||||
// visit io.adafruit.com if you need to create an account,
|
||||
|
|
|
|||
Loading…
Reference in a new issue