Skip to content

Commit 941a9ba

Browse files
committed
Added SPDX to 30 more files - spdx-31
1 parent bfe5427 commit 941a9ba

File tree

30 files changed

+226
-106
lines changed

30 files changed

+226
-106
lines changed

Adafruit_ESP32S2_TFT_WebServer/Adafruit_ESP32S2_TFT_WebServer.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// SPDX-FileCopyrightText: 2015 Hristo Gochkov
2+
//
3+
// SPDX-License-Identifier: LGPL-2.1-or-later
4+
15
/*
26
TFT SPI Flash Server - Example WebServer with internal SPI flash storage
37
for Adafruit ESP32-S2 TFT Feather

Adafruit_Proximity_Trinkey/Capacitive_Touch_One_Pad/code.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
"""
26
CircuitPython Capacitive Touch Pad Example - Print to the serial console when one pad is touched.
37
"""

Adafruit_Proximity_Trinkey/Capacitive_Touch_Two_Pad/code.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
"""
26
CircuitPython Capacitive Two Touch Pad Example - Print to the serial console when a pad is touched.
37
"""

Adafruit_Proximity_Trinkey/NeoPixel_Blink/code.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
"""
26
CircuitPython NeoPixel Blink example - blinking the built-in NeoPixels.
37
"""

Adafruit_Proximity_Trinkey/NeoPixel_Brightness/code.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
"""
26
NeoPixel brightness proximity example. Increases the brightness of the NeoPixels as you move closer
37
to the proximity sensor.

Adafruit_Proximity_Trinkey/Proximity_Spacebar_Game/code.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
"""
26
Proximity spacebar dino game example. Sends a space when you move your hand close to the proximity
37
sensor and turns the LEDs on to let you know you're in the right range. For use with the Chrome
Lines changed: 110 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,110 @@
1-
#include <Adafruit_NeoPixel.h>
2-
#include "Adafruit_FreeTouch.h"
3-
#include "Adafruit_APDS9960.h"
4-
5-
6-
// Create the neopixel strip with the built in definitions NUM_NEOPIXEL and PIN_NEOPIXEL
7-
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_NEOPIXEL, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800);
8-
int16_t neo_brightness = 20; // initialize with 20 brightness (out of 255)
9-
10-
// Create the two touch pads on pins 1 and 2:
11-
Adafruit_FreeTouch qt_1 = Adafruit_FreeTouch(1, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE);
12-
Adafruit_FreeTouch qt_2 = Adafruit_FreeTouch(2, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE);
13-
14-
Adafruit_APDS9960 apds;
15-
16-
void setup() {
17-
Serial.begin(9600);
18-
//while (!Serial);
19-
20-
strip.begin();
21-
strip.setBrightness(neo_brightness);
22-
strip.show(); // Initialize all pixels to 'off'
23-
24-
if (! qt_1.begin())
25-
Serial.println("Failed to begin qt on pin 1");
26-
if (! qt_2.begin())
27-
Serial.println("Failed to begin qt on pin 2");
28-
29-
pinMode(PIN_INTERRUPT, INPUT_PULLUP);
30-
if(!apds.begin()){
31-
Serial.println("failed to initialize device! Please check your wiring.");
32-
while (1) {
33-
strip.fill(0xFF0000);
34-
strip.show();
35-
delay(100);
36-
strip.fill(0x00);
37-
strip.show();
38-
delay(100);
39-
}
40-
}
41-
42-
Serial.println("APDS initialized!");
43-
apds.enableProximity(true);
44-
apds.setProxGain(APDS9960_PGAIN_8X);
45-
apds.setLED(APDS9960_LEDDRIVE_100MA, APDS9960_LEDBOOST_300PCNT);
46-
apds.setProxPulse(APDS9960_PPULSELEN_16US, 1);
47-
48-
//set the interrupt threshold to fire when proximity reading goes above 2
49-
apds.setProximityInterruptThreshold(0, 2);
50-
apds.enableProximityInterrupt();
51-
}
52-
53-
uint8_t j=0;
54-
55-
void loop() {
56-
57-
// print the proximity reading when the interrupt pin goes low
58-
if (!digitalRead(PIN_INTERRUPT)){
59-
uint16_t prox = apds.readProximity();
60-
Serial.print("Proximity: ");
61-
Serial.println(prox);
62-
63-
if (prox < 3) prox = 0; // ignore 1 and 2 readings
64-
strip.setBrightness(prox);
65-
66-
//clear the interrupt
67-
apds.clearInterrupt();
68-
} else {
69-
strip.setBrightness(0);
70-
}
71-
72-
strip.fill(Wheel(j));
73-
strip.show();
74-
75-
// measure the captouches
76-
uint16_t touch1 = qt_1.measure();
77-
uint16_t touch2 = qt_2.measure();
78-
79-
// If the first pad is touched, go forward
80-
if (touch1 > 500) {
81-
Serial.println("QT 1 touched");
82-
j++;
83-
}
84-
85-
// If the second pad is touched, go backward
86-
if (touch2 > 500) {
87-
Serial.println("QT 2 touched");
88-
j--;
89-
}
90-
91-
delay(10);
92-
}
93-
94-
// Input a value 0 to 255 to get a color value.
95-
// The colours are a transition r - g - b - back to r.
96-
uint32_t Wheel(byte WheelPos) {
97-
if(WheelPos < 85) {
98-
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
99-
} else if(WheelPos < 170) {
100-
WheelPos -= 85;
101-
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
102-
} else {
103-
WheelPos -= 170;
104-
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
105-
}
106-
}
1+
// SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
2+
//
3+
// SPDX-License-Identifier: MIT
4+
5+
#include <Adafruit_NeoPixel.h>
6+
#include "Adafruit_FreeTouch.h"
7+
#include "Adafruit_APDS9960.h"
8+
9+
10+
// Create the neopixel strip with the built in definitions NUM_NEOPIXEL and PIN_NEOPIXEL
11+
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_NEOPIXEL, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800);
12+
int16_t neo_brightness = 20; // initialize with 20 brightness (out of 255)
13+
14+
// Create the two touch pads on pins 1 and 2:
15+
Adafruit_FreeTouch qt_1 = Adafruit_FreeTouch(1, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE);
16+
Adafruit_FreeTouch qt_2 = Adafruit_FreeTouch(2, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE);
17+
18+
Adafruit_APDS9960 apds;
19+
20+
void setup() {
21+
Serial.begin(9600);
22+
//while (!Serial);
23+
24+
strip.begin();
25+
strip.setBrightness(neo_brightness);
26+
strip.show(); // Initialize all pixels to 'off'
27+
28+
if (! qt_1.begin())
29+
Serial.println("Failed to begin qt on pin 1");
30+
if (! qt_2.begin())
31+
Serial.println("Failed to begin qt on pin 2");
32+
33+
pinMode(PIN_INTERRUPT, INPUT_PULLUP);
34+
if(!apds.begin()){
35+
Serial.println("failed to initialize device! Please check your wiring.");
36+
while (1) {
37+
strip.fill(0xFF0000);
38+
strip.show();
39+
delay(100);
40+
strip.fill(0x00);
41+
strip.show();
42+
delay(100);
43+
}
44+
}
45+
46+
Serial.println("APDS initialized!");
47+
apds.enableProximity(true);
48+
apds.setProxGain(APDS9960_PGAIN_8X);
49+
apds.setLED(APDS9960_LEDDRIVE_100MA, APDS9960_LEDBOOST_300PCNT);
50+
apds.setProxPulse(APDS9960_PPULSELEN_16US, 1);
51+
52+
//set the interrupt threshold to fire when proximity reading goes above 2
53+
apds.setProximityInterruptThreshold(0, 2);
54+
apds.enableProximityInterrupt();
55+
}
56+
57+
uint8_t j=0;
58+
59+
void loop() {
60+
61+
// print the proximity reading when the interrupt pin goes low
62+
if (!digitalRead(PIN_INTERRUPT)){
63+
uint16_t prox = apds.readProximity();
64+
Serial.print("Proximity: ");
65+
Serial.println(prox);
66+
67+
if (prox < 3) prox = 0; // ignore 1 and 2 readings
68+
strip.setBrightness(prox);
69+
70+
//clear the interrupt
71+
apds.clearInterrupt();
72+
} else {
73+
strip.setBrightness(0);
74+
}
75+
76+
strip.fill(Wheel(j));
77+
strip.show();
78+
79+
// measure the captouches
80+
uint16_t touch1 = qt_1.measure();
81+
uint16_t touch2 = qt_2.measure();
82+
83+
// If the first pad is touched, go forward
84+
if (touch1 > 500) {
85+
Serial.println("QT 1 touched");
86+
j++;
87+
}
88+
89+
// If the second pad is touched, go backward
90+
if (touch2 > 500) {
91+
Serial.println("QT 2 touched");
92+
j--;
93+
}
94+
95+
delay(10);
96+
}
97+
98+
// Input a value 0 to 255 to get a color value.
99+
// The colours are a transition r - g - b - back to r.
100+
uint32_t Wheel(byte WheelPos) {
101+
if(WheelPos < 85) {
102+
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
103+
} else if(WheelPos < 170) {
104+
WheelPos -= 85;
105+
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
106+
} else {
107+
WheelPos -= 170;
108+
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
109+
}
110+
}

Blues_Playground/code.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2018 Anne Barela for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
# Blues Playground Instrument
26
# 2018-06-19 v03
37

Breath_Mask/code.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2018 Mikey Sklar for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
import time
26

37
import adafruit_CCS811

Buckaroo_Plant_Care_Bot/code.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2020 John Park for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
# Bonsai Buckaroo + CLUE Plant Care Bot
26

37
import time

0 commit comments

Comments
 (0)