Skip to content

Commit

Permalink
Merge pull request #69 from adafruit/add-pwm
Browse files Browse the repository at this point in the history
Add PWM Components
  • Loading branch information
lorennorman authored Nov 16, 2022
2 parents 0c8ccc9 + fdb8e02 commit 6a7d094
Show file tree
Hide file tree
Showing 48 changed files with 173 additions and 38 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
componentType: [pin, i2c, servo, ds18x20]
componentType: [pin, i2c, servo, ds18x20, pwm]

name: Validate ${{ matrix.componentType }} Component Definition Files
steps:
Expand Down Expand Up @@ -79,10 +79,10 @@ jobs:
EXIT_VALUE=0
# external contributors can modify some files
EXTERNAL_REGEX="^components\/(pin|i2c|servo|ds18x20)\/.*\/(definition\.json|image\.(png|jpe?g|gif)|animation\.gif)$"
EXTERNAL_REGEX="^components\/(pin|i2c|servo|ds18x20|pwm)\/.*\/(definition\.json|image\.(png|jpe?g|gif)|animation\.gif)$"
# folks with write access to the repo (Adafruit team) can change more sensitive files
INTERNAL_REGEX="^components\/(sensors.json|(pin|i2c|servo|ds18x20)\/(schema.json|.*\/(definition\.json|image\.(png|jpe?g|gif)|animation\.gif)))$"
INTERNAL_REGEX="^components\/(sensors.json|(pin|i2c|servo|ds18x20|pwm)\/(schema.json|.*\/(definition\.json|image\.(png|jpe?g|gif)|animation\.gif)))$"
# apply the appropriate regex based on permissions of the user
if [[ $CAN_WRITE_TO_REPO ]]; then
Expand Down
1 change: 1 addition & 0 deletions components/ds18x20/ds18b20/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "DS18B20",
"published": true,
"subcomponents": ["ambient-temp", "ambient-temp-fahrenheit"],
"sensorResolution": 12
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "High Temp + Waterproof DS18B20",
"published": true,
"subcomponents": ["ambient-temp", "ambient-temp-fahrenheit"],
"sensorResolution": 12
}
1 change: 1 addition & 0 deletions components/ds18x20/ds18b20_waterproof/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "Waterproof DS18B20",
"published": true,
"subcomponents": ["ambient-temp", "ambient-temp-fahrenheit"],
"sensorResolution": 12
}
4 changes: 4 additions & 0 deletions components/ds18x20/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"minLength": 3,
"maxLength": 30
},
"published": {
"description": "If true, this component is supported by the current firmware version and will be displayed to all users. If false, it is hidden behind a developer toggle so that contributors can still work on it against the production site.",
"type": "boolean"
},
"subcomponents": {
"description": "The ambient temperature sensor (and its fahrenheit counterpart) standard on DS18X20 Components",
"type": "array",
Expand Down
1 change: 1 addition & 0 deletions components/i2c/aht20/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "AHT20",
"published": true,
"i2cAddresses": [ "0x38" ],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit", "humidity" ]
}
7 changes: 4 additions & 3 deletions components/i2c/bme280/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName":"BME280",
"i2cAddresses": [ "0x76", "0x77" ],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit", "humidity", "pressure", "altitude" ]
"displayName": "BME280",
"published": true,
"i2cAddresses": [ "0x76", "0x77" ],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit", "humidity", "pressure", "altitude" ]
}
1 change: 1 addition & 0 deletions components/i2c/bme680/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "BME680",
"published": true,
"i2cAddresses": [ "0x76", "0x77" ],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit", "humidity", "pressure", "altitude", "gas-resistance" ]
}
1 change: 1 addition & 0 deletions components/i2c/dps310/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "DPS310",
"published": true,
"i2cAddresses": [ "0x76", "0x77" ],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit", "pressure" ]
}
3 changes: 2 additions & 1 deletion components/i2c/lc709203f/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "LC709203F",
"published": true,
"i2cAddresses": [ "0x0B"],
"subcomponents": [
{
Expand All @@ -11,4 +12,4 @@
"sensorType": "unitless-percent"
}
]
}
}
1 change: 1 addition & 0 deletions components/i2c/mcp9601/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "MCP9601",
"published": true,
"i2cAddresses": [ "0x60", "0x61", "0x62", "0x63", "0x64", "0x65", "0x66", "0x67" ],
"subcomponents": [ "object-temp", "object-temp-fahrenheit", "ambient-temp", "ambient-temp-fahrenheit" ]
}
1 change: 1 addition & 0 deletions components/i2c/mcp9808/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "MCP9808",
"published": true,
"i2cAddresses": [ "0x18", "0x19", "0x1A", "0x1C" ],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit" ]
}
7 changes: 4 additions & 3 deletions components/i2c/pmsa003i/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "PMSA003I",
"i2cAddresses": ["0x12"],
"subcomponents": [ "pm10-std", "pm25-std", "pm100-std"]
"displayName": "PMSA003I",
"published": true,
"i2cAddresses": ["0x12"],
"subcomponents": [ "pm10-std", "pm25-std", "pm100-std"]
}
7 changes: 4 additions & 3 deletions components/i2c/scd30/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "SCD30",
"i2cAddresses": ["0x61"],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit", "humidity", "co2" ]
"displayName": "SCD30",
"published": true,
"i2cAddresses": ["0x61"],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit", "humidity", "co2" ]
}
7 changes: 4 additions & 3 deletions components/i2c/scd40/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "SCD40/SCD41",
"i2cAddresses": ["0x62"],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit", "humidity", "co2" ]
"displayName": "SCD40/SCD41",
"published": true,
"i2cAddresses": ["0x62"],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit", "humidity", "co2" ]
}
4 changes: 4 additions & 0 deletions components/i2c/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
"minLength": 3,
"maxLength": 24
},
"published": {
"description": "If true, this component is supported by the current firmware version and will be displayed to all users. If false, it is hidden behind a developer toggle so that contributors can still work on it against the production site.",
"type": "boolean"
},
"i2cAddresses": {
"description": "List of I2C addresses (as hex string, like \"0x38\") this component can appear on.",
"type": "array",
Expand Down
1 change: 1 addition & 0 deletions components/i2c/sht3x/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "SHT3X",
"published": true,
"i2cAddresses": [ "0x44", "0x45" ],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit", "humidity" ]
}
1 change: 1 addition & 0 deletions components/i2c/sht40/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "SHT40",
"published": true,
"i2cAddresses": [ "0x44" ],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit", "humidity" ]
}
1 change: 1 addition & 0 deletions components/i2c/shtc3/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "SHTC3",
"published": true,
"i2cAddresses": [ "0x70" ],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit", "humidity" ]
}
7 changes: 4 additions & 3 deletions components/i2c/si7021/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "Si7021",
"i2cAddresses": ["0x40"],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit", "humidity" ]
"displayName": "Si7021",
"published": true,
"i2cAddresses": ["0x40"],
"subcomponents": [ "ambient-temp", "ambient-temp-fahrenheit", "humidity" ]
}
3 changes: 2 additions & 1 deletion components/i2c/stemma_soil/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "STEMMA Soil Sensor",
"published": true,
"i2cAddresses": [ "0x36"],
"subcomponents": [
"ambient-temp",
Expand All @@ -9,4 +10,4 @@
"sensorType": "raw"
}
]
}
}
1 change: 1 addition & 0 deletions components/i2c/tsl2591/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "TSL2591",
"published": true,
"i2cAddresses": [ "0x29", "0x39", "0x49" ],
"subcomponents": [ "light" ]
}
1 change: 1 addition & 0 deletions components/i2c/veml7700/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "VEML7700",
"published": true,
"i2cAddresses": [ "0x10" ],
"subcomponents": [ "light" ]
}
2 changes: 1 addition & 1 deletion components/i2c/vl53l0x/definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"defaultPeriod": 900
}
]
}
}
1 change: 1 addition & 0 deletions components/pin/beam_break_sensor/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "Beam Sensor",
"published": true,
"autoSelectString": "beam",
"mode": "DIGITAL",
"direction": "INPUT",
Expand Down
1 change: 1 addition & 0 deletions components/pin/buzzer_5v/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "Buzzer 5V",
"published": true,
"autoSelectString": "buzzer",
"mode": "DIGITAL",
"direction": "OUTPUT",
Expand Down
7 changes: 4 additions & 3 deletions components/pin/flat_vibration_switch/definition.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"displayName":"Flat Vibration Switch",
"mode":"DIGITAL",
"direction":"INPUT",
"displayName": "Flat Vibration Switch",
"published": true,
"mode": "DIGITAL",
"direction": "INPUT",
"defaultPeriod":30,
"visualization": {
"type": "switch",
Expand Down
27 changes: 14 additions & 13 deletions components/pin/hall_effect_sensor/definition.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"displayName":"Hall Effect Sensor",
"mode":"DIGITAL",
"direction":"INPUT",
"defaultPeriod":60,
"selectPullUp": true,
"visualization": {
"type": "switch",
"offLabel": "Sensed!",
"offIcon": "fa6:solid:magnet",
"onLabel": "No Magnet",
"onIcon": "fa6:thin:magnet"
}
}
"displayName": "Hall Effect Sensor",
"published": true,
"mode": "DIGITAL",
"direction": "INPUT",
"defaultPeriod":60,
"selectPullUp": true,
"visualization": {
"type": "switch",
"offLabel": "Sensed!",
"offIcon": "fa6:solid:magnet",
"onLabel": "No Magnet",
"onIcon": "fa6:thin:magnet"
}
}
1 change: 1 addition & 0 deletions components/pin/led/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "LED",
"published": true,
"autoSelectString": "led",
"mode": "DIGITAL",
"direction": "OUTPUT",
Expand Down
1 change: 1 addition & 0 deletions components/pin/light_sensor/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "Light Sensor",
"published": true,
"autoSelectString": "light",
"mode": "ANALOG",
"direction": "INPUT",
Expand Down
1 change: 1 addition & 0 deletions components/pin/non_latching_relay/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "Relay",
"published": true,
"autoSelectString": "relay",
"mode": "DIGITAL",
"direction": "OUTPUT",
Expand Down
1 change: 1 addition & 0 deletions components/pin/pir_sensor/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "PIR Sensor",
"published": true,
"autoSelectString": "pir",
"mode": "DIGITAL",
"direction": "INPUT",
Expand Down
1 change: 1 addition & 0 deletions components/pin/potentiometer/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "Potentiometer",
"published": true,
"autoSelectString": "potentiometer",
"mode": "ANALOG",
"direction": "INPUT",
Expand Down
1 change: 1 addition & 0 deletions components/pin/power_switch_tail/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "Power Switch",
"published": true,
"mode": "DIGITAL",
"direction": "OUTPUT",
"selectPullUp": true,
Expand Down
1 change: 1 addition & 0 deletions components/pin/push_button/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "Push Button",
"published": true,
"autoSelectString": "button",
"mode": "DIGITAL",
"direction": "INPUT",
Expand Down
1 change: 1 addition & 0 deletions components/pin/reed_switch/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "Reed Switch",
"published": true,
"autoSelectString": "reed",
"mode": "DIGITAL",
"direction": "INPUT",
Expand Down
4 changes: 4 additions & 0 deletions components/pin/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"minLength": 3,
"maxLength": 24
},
"published": {
"description": "If true, this component is supported by the current firmware version and will be displayed to all users. If false, it is hidden behind a developer toggle so that contributors can still work on it against the production site.",
"type": "boolean"
},
"mode": {
"description": "This component's mode, either DIGITAL or ANALOG.",
"type": "string",
Expand Down
1 change: 1 addition & 0 deletions components/pin/toggle_switch/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "Toggle Switch",
"published": true,
"autoSelectString": "toggle",
"mode": "DIGITAL",
"direction": "INPUT",
Expand Down
1 change: 1 addition & 0 deletions components/pin/water_sensor/definition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"displayName": "Water Sensor",
"published": true,
"autoSelectString": "water",
"mode": "DIGITAL",
"direction": "INPUT",
Expand Down
8 changes: 8 additions & 0 deletions components/pwm/dimmable_led/definition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"displayName": "Dimmable LED",
"published": true,
"pwmSetting": "fixedFrequency",
"visualization": {
"type": "slider-pwm"
}
}
Binary file added components/pwm/dimmable_led/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions components/pwm/piezo_buzzer/definition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"displayName": "Piezo Buzzer",
"published": true,
"pwmSetting": "variableFrequency",
"visualization": {
"type": "switch-pwm",
"offLabel": "Off",
"offIcon": "fa6:regular:bell-slash",
"onLabel": "On",
"onIcon": "fa6:solid:bell-on"
}
}
Binary file added components/pwm/piezo_buzzer/image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions components/pwm/rgb_led/definition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"displayName": "RGB LED",
"pwmSetting": "fixedFrequency",
"visualization": {
"type": "color-picker"
}
}
Binary file added components/pwm/rgb_led/image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6a7d094

Please sign in to comment.