Merge pull request #2057 from adafruit/spdx-35

Added SPDX to 30 more files - spdx-35
This commit is contained in:
Anne Barela 2022-02-24 20:38:30 -05:00 committed by GitHub
commit f8a82d5a7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 980 additions and 860 deletions

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Limor Fried for Adafruit Industries
//
// SPDX-License-Identifier: MIT
// Stream MP3s over WiFi on Metro M4 Express and play via music maker shield
#include <SPI.h>

View file

@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
import digitalio

View file

@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2019 Anne Barela for Adafruit Industries
#
# SPDX-License-Identifier: MIT
from time import sleep
from adafruit_ble.uart_client import UARTClient
from adafruit_ble.scanner import Scanner

View file

@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2019 Anne Barela for Adafruit Industries
#
# SPDX-License-Identifier: MIT
from time import sleep
from adafruit_ble.uart_server import UARTServer
from adafruit_bluefruit_connect.packet import Packet

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Dan Cogliano for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
const uint8_t meteocons12pt7bBitmaps[] PROGMEM = {
@ -312,4 +316,4 @@ const GFXfont meteocons12pt7b PROGMEM = {
(GFXglyph *)meteocons12pt7bGlyphs,
0x20, 0x7E, 25 };
// Approx. 3162 bytes
// Approx. 3162 bytes

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Dan Cogliano for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
const uint8_t meteocons16pt7bBitmaps[] PROGMEM = {
@ -446,4 +450,4 @@ const GFXfont meteocons16pt7b PROGMEM = {
(GFXglyph *)meteocons16pt7bGlyphs,
0x20, 0x7E, 32 };
// Approx. 4776 bytes
// Approx. 4776 bytes

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Dan Cogliano for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
const uint8_t meteocons20pt7bBitmaps[] PROGMEM = {
@ -642,4 +646,4 @@ const GFXfont meteocons20pt7b PROGMEM = {
(GFXglyph *)meteocons20pt7bGlyphs,
0x20, 0x7E, 40 };
// Approx. 7124 bytes
// Approx. 7124 bytes

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Dan Cogliano for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
const uint8_t meteocons24pt7bBitmaps[] PROGMEM = {
@ -891,4 +895,4 @@ const GFXfont meteocons24pt7b PROGMEM = {
(GFXglyph *)meteocons24pt7bGlyphs,
0x20, 0x7E, 48 };
// Approx. 10108 bytes
// Approx. 10108 bytes

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Dan Cogliano for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
const uint8_t meteocons36pt7bBitmaps[] PROGMEM = {
@ -1882,4 +1886,4 @@ const GFXfont meteocons36pt7b PROGMEM = {
(GFXglyph *)meteocons36pt7bGlyphs,
0x20, 0x7E, 73 };
// Approx. 22006 bytes
// Approx. 22006 bytes

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Dan Cogliano for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
const uint8_t meteocons48pt7bBitmaps[] PROGMEM = {
@ -3242,4 +3246,4 @@ const GFXfont meteocons48pt7b PROGMEM = {
(GFXglyph *)meteocons48pt7bGlyphs,
0x20, 0x7E, 96 };
// Approx. 38323 bytes
// Approx. 38323 bytes

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Dan Cogliano for Adafruit Industries
//
// SPDX-License-Identifier: MIT
const uint8_t moon_phases12pt7bBitmaps[] PROGMEM = {
0x00, 0xFC, 0x00, 0x0F, 0xFE, 0x00, 0xFF, 0xFC, 0x07, 0xFF, 0xE8, 0x3F,
0xFF, 0xD0, 0xFF, 0xFF, 0xE7, 0xFF, 0xFE, 0x9F, 0xFF, 0xFE, 0xFF, 0xFF,

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Dan Cogliano for Adafruit Industries
//
// SPDX-License-Identifier: MIT
const uint8_t moon_phases16pt7bBitmaps[] PROGMEM = {
0x00, 0x3F, 0xC0, 0x00, 0x0F, 0xFF, 0x00, 0x03, 0xFF, 0xEC, 0x00, 0x7F,
0xFF, 0xE0, 0x0F, 0xFF, 0xFD, 0x01, 0xFF, 0xFF, 0xE8, 0x3F, 0xFF, 0xFE,

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Dan Cogliano for Adafruit Industries
//
// SPDX-License-Identifier: MIT
const uint8_t moon_phases20pt7bBitmaps[] PROGMEM = {
0x00, 0x07, 0xF8, 0x00, 0x00, 0x07, 0xFF, 0x60, 0x00, 0x03, 0xFF, 0xFF,
0x00, 0x00, 0xFF, 0xFF, 0xD8, 0x00, 0x7F, 0xFF, 0xFE, 0x80, 0x1F, 0xFF,

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Dan Cogliano for Adafruit Industries
//
// SPDX-License-Identifier: MIT
const uint8_t moon_phases24pt7bBitmaps[] PROGMEM = {
0x00, 0x00, 0x7F, 0xC0, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0x80, 0x00, 0x00,
0x3F, 0xFE, 0xFC, 0x00, 0x00, 0x1F, 0xFF, 0xFB, 0xC0, 0x00, 0x07, 0xFF,

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Dan Cogliano for Adafruit Industries
//
// SPDX-License-Identifier: MIT
const uint8_t moon_phases36pt7bBitmaps[] PROGMEM = {
0x00, 0x00, 0x00, 0x1F, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0x7E, 0x00, 0x00,

View file

@ -1,183 +1,187 @@
#include "OpenWeatherMap.h"
String AirliftOpenWeatherMap::buildUrlCurrent(String appId, String location) {
String units = OWM_METRIC ? "metric" : "imperial";
return "http://api.openweathermap.org/data/2.5/weather?q=" + location + "&appid=" + appId + "&units=" + units + "&lang=" + String(OWM_LANGUAGE);
}
String AirliftOpenWeatherMap::buildUrlForecast(String appId, String location) {
String units = OWM_METRIC ? "metric" : "imperial";
return "http://api.openweathermap.org/data/2.5/forecast?q=" + location + "&cnt=6&appid=" + appId + "&units=" + units + "&lang=" + String(OWM_LANGUAGE);
}
String AirliftOpenWeatherMap::getMeteoconIcon(String icon) {
// clear sky
// 01d
if (icon == "01d") {
return "B";
}
// 01n
if (icon == "01n") {
return "C";
}
// few clouds
// 02d
if (icon == "02d") {
return "H";
}
// 02n
if (icon == "02n") {
return "4";
}
// scattered clouds
// 03d
if (icon == "03d") {
return "N";
}
// 03n
if (icon == "03n") {
return "5";
}
// broken clouds
// 04d
if (icon == "04d") {
return "Y";
}
// 04n
if (icon == "04n") {
return "%";
}
// shower rain
// 09d
if (icon == "09d") {
return "R";
}
// 09n
if (icon == "09n") {
return "8";
}
// rain
// 10d
if (icon == "10d") {
return "Q";
}
// 10n
if (icon == "10n") {
return "7";
}
// thunderstorm
// 11d
if (icon == "11d") {
return "P";
}
// 11n
if (icon == "11n") {
return "6";
}
// snow
// 13d
if (icon == "13d") {
return "W";
}
// 13n
if (icon == "13n") {
return "#";
}
// mist
// 50d
if (icon == "50d") {
return "M";
}
// 50n
if (icon == "50n") {
return "M";
}
// Nothing matched: N/A
return ")";
}
bool AirliftOpenWeatherMap::updateCurrent(OpenWeatherMapCurrentData &data, String json)
{
Serial->println("updateCurrent()");
DynamicJsonDocument doc(2000);
//StaticJsonDocument<2000> doc;
DeserializationError error = deserializeJson(doc, json);
if (error) {
Serial->println(String("deserializeJson() failed: ") + (const char *)error.c_str());
Serial->println(json);
setError(String("deserializeJson() failed: ") + error.c_str());
return false;
}
int code = (int) doc["cod"];
if(code != 200)
{
Serial->println(String("OpenWeatherMap error: ") + (const char *)doc["message"]);
setError(String("OpenWeatherMap error: ") + (const char *)doc["message"]);
return false;
}
data.lat = (float) doc["coord"]["lat"];
data.lon = (float) doc["coord"]["lon"];
data.main = (const char*) doc["weather"][0]["main"];
data.description = (const char*) doc["weather"][0]["description"];
data.icon = (const char*) doc["weather"][0]["icon"];
data.cityName = (const char*) doc["name"];
data.visibility = (uint16_t) doc["visibility"];
data.timezone = (time_t) doc["timezone"];
data.country = (const char*) doc["sys"]["country"];
data.observationTime = (time_t) doc["dt"];
data.sunrise = (time_t) doc["sys"]["sunrise"];
data.sunset = (time_t) doc["sys"]["sunset"];
data.temp = (float) doc["main"]["temp"];
data.pressure = (uint16_t) doc["main"]["pressure"];
data.humidity = (uint8_t) doc["main"]["humidity"];
data.tempMin = (float) doc["main"]["temp_min"];
data.tempMax = (float) doc["main"]["temp_max"];
data.windSpeed = (float) doc["wind"]["speed"];
data.windDeg = (float) doc["wind"]["deg"];
return true;
}
bool AirliftOpenWeatherMap::updateForecast(OpenWeatherMapForecastData &data, String json, int day)
{
Serial->println("updateForecast()");
DynamicJsonDocument doc(5000);
//StaticJsonDocument<5000> doc;
DeserializationError error = deserializeJson(doc, json);
if (error) {
Serial->println(String("deserializeJson() failed: ") + (const char *)error.c_str());
Serial->println(json);
setError(String("deserializeJson() failed: ") + error.c_str());
return false;
}
int code = (int) doc["cod"];
if(code != 200)
{
Serial->println(String("OpenWeatherMap error: ") + (const char *)doc["message"]);
setError(String("OpenWeatherMap error: ") + (const char *)doc["message"]);
return false;
}
data.observationTime = (time_t) doc["list"][day]["dt"];
data.temp = (float) doc["list"][day]["main"]["temp"];
data.pressure = (uint16_t) doc["list"][day]["main"]["pressure"];
data.humidity = (uint8_t) doc["list"][day]["main"]["humidity"];
data.tempMin = (float) doc["list"][day]["main"]["temp_min"];
data.tempMax = (float) doc["list"][day]["main"]["temp_max"];
data.main = (const char*) doc["list"][day]["weather"][0]["main"];
data.description = (const char*) doc["list"][day]["weather"][0]["description"];
data.icon = (const char*) doc["list"][day]["weather"][0]["icon"];
return true;
}
// SPDX-FileCopyrightText: 2019 Dan Cogliano for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#include "OpenWeatherMap.h"
String AirliftOpenWeatherMap::buildUrlCurrent(String appId, String location) {
String units = OWM_METRIC ? "metric" : "imperial";
return "http://api.openweathermap.org/data/2.5/weather?q=" + location + "&appid=" + appId + "&units=" + units + "&lang=" + String(OWM_LANGUAGE);
}
String AirliftOpenWeatherMap::buildUrlForecast(String appId, String location) {
String units = OWM_METRIC ? "metric" : "imperial";
return "http://api.openweathermap.org/data/2.5/forecast?q=" + location + "&cnt=6&appid=" + appId + "&units=" + units + "&lang=" + String(OWM_LANGUAGE);
}
String AirliftOpenWeatherMap::getMeteoconIcon(String icon) {
// clear sky
// 01d
if (icon == "01d") {
return "B";
}
// 01n
if (icon == "01n") {
return "C";
}
// few clouds
// 02d
if (icon == "02d") {
return "H";
}
// 02n
if (icon == "02n") {
return "4";
}
// scattered clouds
// 03d
if (icon == "03d") {
return "N";
}
// 03n
if (icon == "03n") {
return "5";
}
// broken clouds
// 04d
if (icon == "04d") {
return "Y";
}
// 04n
if (icon == "04n") {
return "%";
}
// shower rain
// 09d
if (icon == "09d") {
return "R";
}
// 09n
if (icon == "09n") {
return "8";
}
// rain
// 10d
if (icon == "10d") {
return "Q";
}
// 10n
if (icon == "10n") {
return "7";
}
// thunderstorm
// 11d
if (icon == "11d") {
return "P";
}
// 11n
if (icon == "11n") {
return "6";
}
// snow
// 13d
if (icon == "13d") {
return "W";
}
// 13n
if (icon == "13n") {
return "#";
}
// mist
// 50d
if (icon == "50d") {
return "M";
}
// 50n
if (icon == "50n") {
return "M";
}
// Nothing matched: N/A
return ")";
}
bool AirliftOpenWeatherMap::updateCurrent(OpenWeatherMapCurrentData &data, String json)
{
Serial->println("updateCurrent()");
DynamicJsonDocument doc(2000);
//StaticJsonDocument<2000> doc;
DeserializationError error = deserializeJson(doc, json);
if (error) {
Serial->println(String("deserializeJson() failed: ") + (const char *)error.c_str());
Serial->println(json);
setError(String("deserializeJson() failed: ") + error.c_str());
return false;
}
int code = (int) doc["cod"];
if(code != 200)
{
Serial->println(String("OpenWeatherMap error: ") + (const char *)doc["message"]);
setError(String("OpenWeatherMap error: ") + (const char *)doc["message"]);
return false;
}
data.lat = (float) doc["coord"]["lat"];
data.lon = (float) doc["coord"]["lon"];
data.main = (const char*) doc["weather"][0]["main"];
data.description = (const char*) doc["weather"][0]["description"];
data.icon = (const char*) doc["weather"][0]["icon"];
data.cityName = (const char*) doc["name"];
data.visibility = (uint16_t) doc["visibility"];
data.timezone = (time_t) doc["timezone"];
data.country = (const char*) doc["sys"]["country"];
data.observationTime = (time_t) doc["dt"];
data.sunrise = (time_t) doc["sys"]["sunrise"];
data.sunset = (time_t) doc["sys"]["sunset"];
data.temp = (float) doc["main"]["temp"];
data.pressure = (uint16_t) doc["main"]["pressure"];
data.humidity = (uint8_t) doc["main"]["humidity"];
data.tempMin = (float) doc["main"]["temp_min"];
data.tempMax = (float) doc["main"]["temp_max"];
data.windSpeed = (float) doc["wind"]["speed"];
data.windDeg = (float) doc["wind"]["deg"];
return true;
}
bool AirliftOpenWeatherMap::updateForecast(OpenWeatherMapForecastData &data, String json, int day)
{
Serial->println("updateForecast()");
DynamicJsonDocument doc(5000);
//StaticJsonDocument<5000> doc;
DeserializationError error = deserializeJson(doc, json);
if (error) {
Serial->println(String("deserializeJson() failed: ") + (const char *)error.c_str());
Serial->println(json);
setError(String("deserializeJson() failed: ") + error.c_str());
return false;
}
int code = (int) doc["cod"];
if(code != 200)
{
Serial->println(String("OpenWeatherMap error: ") + (const char *)doc["message"]);
setError(String("OpenWeatherMap error: ") + (const char *)doc["message"]);
return false;
}
data.observationTime = (time_t) doc["list"][day]["dt"];
data.temp = (float) doc["list"][day]["main"]["temp"];
data.pressure = (uint16_t) doc["list"][day]["main"]["pressure"];
data.humidity = (uint8_t) doc["list"][day]["main"]["humidity"];
data.tempMin = (float) doc["list"][day]["main"]["temp_min"];
data.tempMax = (float) doc["list"][day]["main"]["temp_max"];
data.main = (const char*) doc["list"][day]["weather"][0]["main"];
data.description = (const char*) doc["list"][day]["weather"][0]["description"];
data.icon = (const char*) doc["list"][day]["weather"][0]["icon"];
return true;
}

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Dan Cogliano for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
#include "secrets.h"
#include <ArduinoJson.h> //https://github.com/bblanchon/ArduinoJson

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Dan Cogliano for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
// secrets.h

View file

@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2017 John Edgar Park for Adafruit Industries
#
# SPDX-License-Identifier: MIT
# FruitBox Sequencer
# for Adafruit Circuit Playground express
# with CircuitPython

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2017 Phillip Burgess for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#include <Adafruit_NeoPixel.h>
#define PIN 1

View file

@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2017 Phillip Burgess for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
import board

View file

@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT
from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.nordic import UARTService

View file

@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import board
import neopixel

View file

@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT
from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.nordic import UARTService

View file

@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT
from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.nordic import UARTService

View file

@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2018 Dave Astels for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
HalloWing Interactive Cat Toy

View file

@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2018 Brent Rubell for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
'io_home_security.py'
=======================================

View file

@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2018 Limor Fried for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
import board
import busio

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2019 Anne Barela for Adafruit Industries
//
// SPDX-License-Identifier: MIT
/*********************
* connect the COIN wire to digital 2
* set the side switches to "FAST" "NC"