Skip to content

Commit 1950eda

Browse files
committed
Merge remote-tracking branch 'origin/main' into spdx-test
2 parents a8ff695 + d4184d3 commit 1950eda

File tree

336 files changed

+4200
-2309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

336 files changed

+4200
-2309
lines changed

Adafruit_ESP32_Arduino_Demos/ESP32_sleeptest/.esp32.test.only

Whitespace-only changes.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// SPDX-FileCopyrightText: 2022 Limor Fried for Adafruit Industries
2+
//
3+
// SPDX-License-Identifier: MIT
4+
5+
#include <Adafruit_NeoPixel.h>
6+
7+
#if defined(PIN_NEOPIXEL)
8+
Adafruit_NeoPixel pixel(1, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800);
9+
#endif
10+
11+
void setup() {
12+
Serial.begin(115200);
13+
14+
// Turn on any internal power switches for TFT, NeoPixels, I2C, etc!
15+
enableInternalPower();
16+
}
17+
18+
void loop() {
19+
LEDon();
20+
delay(1000);
21+
22+
disableInternalPower();
23+
esp_sleep_enable_timer_wakeup(1000000); // 1 sec
24+
esp_light_sleep_start();
25+
// we'll wake from light sleep here
26+
27+
// wake up 1 second later and then go into deep sleep
28+
esp_sleep_enable_timer_wakeup(1000000); // 1 sec
29+
esp_deep_sleep_start();
30+
// we never reach here
31+
}
32+
33+
void LEDon() {
34+
#if defined(PIN_NEOPIXEL)
35+
pixel.begin(); // INITIALIZE NeoPixel
36+
pixel.setBrightness(20); // not so bright
37+
pixel.setPixelColor(0, 0xFFFFFF);
38+
pixel.show();
39+
#endif
40+
}
41+
42+
void LEDoff() {
43+
#if defined(PIN_NEOPIXEL)
44+
pixel.setPixelColor(0, 0x0);
45+
pixel.show();
46+
#endif
47+
}
48+
49+
void enableInternalPower() {
50+
#if defined(ARDUINO_ADAFRUIT_QTPY_ESP32_PICO)
51+
pinMode(NEOPIXEL_POWER, OUTPUT);
52+
digitalWrite(NEOPIXEL_POWER, HIGH);
53+
#endif
54+
55+
#if defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
56+
// turn on the I2C power by setting pin to opposite of 'rest state'
57+
pinMode(PIN_I2C_POWER, INPUT);
58+
delay(1);
59+
bool polarity = digitalRead(PIN_I2C_POWER);
60+
pinMode(PIN_I2C_POWER, OUTPUT);
61+
digitalWrite(PIN_I2C_POWER, !polarity);
62+
pinMode(NEOPIXEL_POWER, OUTPUT);
63+
digitalWrite(NEOPIXEL_POWER, HIGH);
64+
#endif
65+
}
66+
67+
void disableInternalPower() {
68+
#if defined(ARDUINO_ADAFRUIT_QTPY_ESP32_PICO)
69+
pinMode(NEOPIXEL_POWER, OUTPUT);
70+
digitalWrite(NEOPIXEL_POWER, LOW);
71+
#endif
72+
73+
#if defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
74+
// turn on the I2C power by setting pin to rest state (off)
75+
pinMode(PIN_I2C_POWER, INPUT);
76+
pinMode(NEOPIXEL_POWER, OUTPUT);
77+
digitalWrite(NEOPIXEL_POWER, LOW);
78+
#endif
79+
}

Adafruit_ESP32_Arduino_Demos/streaming_mp3_player/streaming_mp3_player.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// SPDX-FileCopyrightText: 2019 Limor Fried for Adafruit Industries
2+
//
3+
// SPDX-License-Identifier: MIT
4+
15
// Stream MP3s over WiFi on Metro M4 Express and play via music maker shield
26

37
#include <SPI.h>

Adafruit_IO_Power_Relay/code.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2020 Brent Rubell for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
import time
26
import board
37
import busio

Adafruit_IO_Power_Relay/code_light_sensor/code.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2020 Brent Rubell for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
import time
26
import board
37
import busio

Adafruit_LED_Sequins/Adafruit_LED_Sequins.ino

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
int brightness = 0; // how bright the LED is
26
int fadeAmount = 5; // how many points to fade the LED by
37
int counter = 0; // counter to keep track of cycles

Adafruit_LED_Sequins/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 board

Adafruit_MTK3329_GPS/GPStest/GPStest.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// SPDX-FileCopyrightText: 2019 Anne Barela for Adafruit Industries
2+
//
3+
// SPDX-License-Identifier: MIT
4+
15
// Test code for Adafruit GPS modules using MTK driver
26
// such as www.adafruit.com/products/660 (discontinued)
37
// For new use see www.adafruit.com/products/746 (needs different code)

Adafruit_X2_Time_Ball/Arduino/LEDstream/LEDstream.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// SPDX-FileCopyrightText: 2019 Anne Barela for Adafruit Industries
2+
//
3+
// SPDX-License-Identifier: MIT
4+
15
// Arduino "bridge" code between host computer and WS2801-based digital
26
// RGB LED pixels (e.g. Adafruit product ID #322). Intended for use
37
// with USB-native boards such as Teensy or Adafruit 32u4 Breakout;

Adafruit_X2_Time_Ball/Arduino/LEDtest/LEDtest.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// SPDX-FileCopyrightText: 2019 Anne Barela for Adafruit Industries
2+
//
3+
// SPDX-License-Identifier: MIT
4+
15
/*****************************************************************************
26
Sketch for testing WS2801 LED strands - lights one LED along length of strand.
37
Because only one LED is lit at a time, can safely be powered from Arduino +5V.

0 commit comments

Comments
 (0)