Skip to content

Commit 1faa9af

Browse files
authored
Merge branch 'adafruit:main' into main
2 parents 5e95fbf + 4c7517f commit 1faa9af

File tree

1,104 files changed

+155421
-882
lines changed

Some content is hidden

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

1,104 files changed

+155421
-882
lines changed

.github/workflows/arduino_cron.yml

+12-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
outputs:
1313
answer: ${{ steps.is-needed.outputs.answer }}
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 2
1818
- name: Check if run by adabot
@@ -39,7 +39,8 @@ jobs:
3939
[[ $changedfile == *.cpp ]] ||
4040
[[ $changedfile == *.h ]] ||
4141
[[ $changedfile == *.hpp ]] ||
42-
[[ $changedfile == *.ino ]]; then
42+
[[ $changedfile == *.ino ]] ||
43+
[[ $changedfile == *.yml ]]; then
4344
ischanged=true
4445
break
4546
fi
@@ -60,16 +61,20 @@ jobs:
6061
strategy:
6162
fail-fast: false
6263
matrix:
63-
arduino-platform: ["cpb", "cpc", "cpx_ada", "esp32", "esp8266", "feather32u4", "feather_m0_express", "feather_m4_express", "feather_rp2040", "flora", "funhouse", "gemma", "gemma_m0", "hallowing_m0", "hallowing_m4_tinyusb", "magtag", "metro_m0", "metro_m0_tinyusb", "metro_m4", "metro_m4_tinyusb", "monster_m4sk", "monster_m4sk_tinyusb", "neokeytrinkey_m0", "neotrellis_m4", "nrf52832", "nrf52840", "protrinket_5v", "proxlighttrinkey_m0", "pybadge", "pygamer", "pyportal", "qualia_s3_rgb666", "qt2040_trinkey", "qtpy_m0", "qtpy_esp32s2", "rotarytrinkey_m0", "slidetrinkey_m0", "trinket_m0", "uno", "trinket_5v", "ledglasses_nrf52840" ]
64+
arduino-platform: ["cpb", "cpc", "cpx_ada", "esp32", "esp8266", "feather32u4", "feather_esp32c6", "feather_m0_express", "feather_m4_express", "feather_rp2040", "feather_rp2040_adalogger", "flora", "funhouse", "gemma", "gemma_m0", "hallowing_m0", "hallowing_m4_tinyusb", "ledglasses_nrf52840", "magtag", "metro_m0", "metro_m0_tinyusb", "metro_m4", "metro_m4_tinyusb", "monster_m4sk", "monster_m4sk_tinyusb", "neokeytrinkey_m0", "neotrellis_m4", "nrf52832", "nrf52840", "pixeltrinkey_m0", "protrinket_5v", "proxlighttrinkey_m0", "pybadge", "pycamera_s3", "pygamer", "pyportal", "qualia_s3_rgb666", "qt2040_trinkey", "qtpy_m0", "qtpy_esp32s2", "rotarytrinkey_m0", "sht4xtrinkey_m0", "slidetrinkey_m0", "trinket_5v", "trinket_m0", "uno"]
6465
runs-on: ubuntu-latest
6566
if: needs.check-if-needed.outputs.answer == 'true'
6667
needs: check-if-needed
6768
steps:
68-
- uses: actions/setup-python@v4
69+
- uses: actions/setup-python@v5
6970
with:
7071
python-version: "3.x"
71-
- uses: actions/checkout@v3
72-
- uses: actions/checkout@v3
72+
73+
# Checkout the learn repo itself
74+
- uses: actions/checkout@v4
75+
76+
# Checkout the CI scripts
77+
- uses: actions/checkout@v4
7378
with:
7479
repository: adafruit/ci-arduino
7580
path: ci
@@ -98,7 +103,7 @@ jobs:
98103

99104

100105
- name: Upload build artifacts
101-
uses: actions/upload-artifact@v3
106+
uses: actions/upload-artifact@v4
102107
with:
103108
name: ${{ github.event.repository.name }}.${{ github.sha }}
104109
path: |

.github/workflows/githubci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ jobs:
66
spdx:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/setup-python@v4
9+
- uses: actions/setup-python@v5
1010
with:
1111
python-version: "3.x"
1212
- name: Checkout Current Repo
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414

1515
- name: check SPDX licensing
1616
run: python ./SPDX.py
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Set up Python 3.10
22-
uses: actions/setup-python@v4
22+
uses: actions/setup-python@v5
2323
with:
2424
python-version: "3.10"
2525
- name: Versions
@@ -29,7 +29,7 @@ jobs:
2929
run: |
3030
pip install --force-reinstall pylint==2.7.1
3131
- name: Checkout Current Repo
32-
uses: actions/checkout@v3
32+
uses: actions/checkout@v4
3333

3434
- name: lint
3535
run: ./pylint_check.sh

.github/workflows/images.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
GITHUB_CONTEXT: ${{ toJson(github) }}
2222
run: echo "$GITHUB_CONTEXT"
2323

24-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2525

2626
- name: Set up Python 3.x
27-
uses: actions/setup-python@v4
27+
uses: actions/setup-python@v5
2828
with:
2929
python-version: "3.x"
3030

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// SPDX-FileCopyrightText: 2024 Liz Clark for Adafruit Industries
2+
//
3+
// SPDX-License-Identifier: MIT
4+
5+
#include <Adafruit_ADG72x.h>
6+
7+
Adafruit_ADG72x adg72x;
8+
9+
bool isADG728 = false; // which chip are we connected to?
10+
11+
int analogIn = A0;
12+
int analogValue = 0;
13+
unsigned long switchTimer = 1000; // 1000 ms = 1 second for channel switch
14+
unsigned long readTimer = 10; // 10 ms for analog read
15+
unsigned long lastSwitchTime = 0; // Last time the channels were switched
16+
unsigned long lastReadTime = 0; // Last time the analog was read
17+
uint8_t currentChannel = 0; // Current channel being selected
18+
19+
void setup() {
20+
Serial.begin(115200);
21+
22+
// Wait for serial port to open
23+
while (!Serial) {
24+
delay(1);
25+
}
26+
27+
// Try with the ADG728 default address first...
28+
if (adg72x.begin(ADG728_DEFAULT_ADDR, &Wire)) {
29+
Serial.println("ADG728 found!");
30+
isADG728 = true;
31+
}
32+
// Maybe they have an ADG729?
33+
else if (adg72x.begin(ADG729_DEFAULT_ADDR, &Wire)) {
34+
Serial.println("ADG729 found!");
35+
isADG728 = false;
36+
}
37+
else {
38+
Serial.println("No ADG device found? Check wiring!");
39+
while (1); // Stop here if no device was found
40+
}
41+
}
42+
43+
void loop() {
44+
unsigned long currentTime = millis();
45+
46+
// read and print analog value every 10ms
47+
if ((currentTime - lastReadTime) >= readTimer) {
48+
analogValue = analogRead(analogIn);
49+
Serial.println(analogValue);
50+
lastReadTime = currentTime;
51+
}
52+
53+
// switch channels every 1 second
54+
if ((currentTime - lastSwitchTime) >= switchTimer) {
55+
uint8_t bits = 1 << currentChannel; // Shift a '1' from LSB to MSB
56+
if (!adg72x.selectChannels(bits)) {
57+
Serial.println("Failed to set channels...");
58+
}
59+
/*Serial.print((currentChannel % 4) + 1);
60+
if (currentChannel < 4) Serial.println("A");
61+
else Serial.println("B");*/
62+
currentChannel = (currentChannel + 1) % 8; // Move to the next channel, wrap around at 8
63+
lastSwitchTime = currentTime;
64+
}
65+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// SPDX-FileCopyrightText: 2024 Liz Clark for Adafruit Industries
2+
//
3+
// SPDX-License-Identifier: MIT
4+
5+
#include <Adafruit_ADG72x.h>
6+
7+
Adafruit_ADG72x adg72x;
8+
9+
int analogInA0 = A0;
10+
int analogInA1 = A1;
11+
int analogValueDA = 0;
12+
int analogValueDB = 0;
13+
unsigned long switchTimer = 1000; // 1000 ms = 1 second for channel switch
14+
unsigned long readTimer = 10; // 10 ms for analog read
15+
unsigned long lastSwitchTime = 0; // Last time the channels were switched
16+
unsigned long lastReadTime = 0; // Last time the analog was read
17+
uint8_t currentChannel = 0; // Current channel being selected
18+
19+
void setup() {
20+
Serial.begin(115200);
21+
22+
// Wait for serial port to open
23+
while (!Serial) {
24+
delay(1);
25+
}
26+
27+
// Try with the ADG728 default address first...
28+
if (adg72x.begin(ADG728_DEFAULT_ADDR, &Wire)) {
29+
//Serial.println("ADG728 found!");
30+
}
31+
// Maybe they have an ADG729?
32+
else if (adg72x.begin(ADG729_DEFAULT_ADDR, &Wire)) {
33+
//Serial.println("ADG729 found!");
34+
}
35+
else {
36+
Serial.println("No ADG72x device found? Check wiring!");
37+
while (1); // Stop here if no device was found
38+
}
39+
}
40+
41+
void loop() {
42+
unsigned long currentTime = millis();
43+
44+
// read and print analog value every 10ms
45+
if ((currentTime - lastReadTime) >= readTimer) {
46+
analogValueDA = analogRead(analogInA0);
47+
analogValueDB = analogRead(analogInA1);
48+
Serial.print(analogValueDA);
49+
Serial.print(",");
50+
Serial.println(analogValueDB);
51+
lastReadTime = currentTime;
52+
}
53+
54+
// switch channels every 1 second
55+
if ((currentTime - lastSwitchTime) >= switchTimer) {
56+
uint8_t bits = 1 << currentChannel; // Shift a '1' from LSB to MSB
57+
if (!adg72x.selectChannels(bits)) {
58+
Serial.println("Failed to set channels...");
59+
}
60+
/*Serial.print((currentChannel % 4) + 1);
61+
if (currentChannel < 4) Serial.println("A");
62+
else Serial.println("B");*/
63+
currentChannel = (currentChannel + 1) % 8; // Move to the next channel, wrap around at 8
64+
lastSwitchTime = currentTime;
65+
}
66+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2024 Liz Clark for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
import time
6+
import board
7+
import adafruit_adg72x
8+
from analogio import AnalogIn
9+
10+
analog_in = AnalogIn(board.A0)
11+
12+
i2c = board.I2C()
13+
switch = adafruit_adg72x.ADG72x(i2c)
14+
15+
c = 0
16+
switch_time = 2
17+
channels = [0, 4]
18+
clock = time.monotonic()
19+
while True:
20+
if (time.monotonic() - clock) > switch_time:
21+
print(f"Selecting channel {channels[c] + 1}")
22+
switch.channel = channels[c]
23+
c = (c + 1) % 2
24+
clock = time.monotonic()
25+
print((analog_in.value,))
26+
time.sleep(0.1)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2024 Liz Clark for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
import time
6+
import board
7+
import adafruit_adg72x
8+
from analogio import AnalogIn
9+
10+
analog_in_DA = AnalogIn(board.A0)
11+
analog_in_DB = AnalogIn(board.A1)
12+
13+
i2c = board.I2C()
14+
switch = adafruit_adg72x.ADG72x(i2c, 0x44)
15+
16+
c = 0
17+
switch_time = 3
18+
clock = time.monotonic()
19+
20+
while True:
21+
if (time.monotonic() - clock) > switch_time:
22+
if c < 4:
23+
channels = "A"
24+
else:
25+
channels = "B"
26+
print(f"Selecting channel {(c % 4) + 1}{channels}")
27+
switch.channel = c
28+
c = (c + 1) % 8
29+
clock = time.monotonic()
30+
print((analog_in_DA.value, analog_in_DB.value,))
31+
time.sleep(0.1)

Adafruit_ESP32_Arduino_Demos/ESP32_sleeptest/ESP32_sleeptest.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//#define ADAFRUIT_FEATHER_ESP32_V2
1010

1111
// then these pins will be defined for us
12-
#if defined(ADAFRUIT_FEATHER_ESP32_V2)
12+
#if defined(ADAFRUIT_FEATHER_ESP32_V2) or defined(ARDUINO_ADAFRUIT_ITSYBITSY_ESP32)
1313
#define PIN_NEOPIXEL 0
1414
#define NEOPIXEL_I2C_POWER 2
1515
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
4+
"""
5+
This test will initialize the display using displayio and draw a solid green
6+
background, a smaller purple rectangle, and some yellow text.
7+
"""
8+
import board
9+
import terminalio
10+
import displayio
11+
from adafruit_display_text import label
12+
13+
# First set some parameters used for shapes and text
14+
BORDER = 20
15+
FONTSCALE = 2
16+
BACKGROUND_COLOR = 0x00FF00 # Bright Green
17+
FOREGROUND_COLOR = 0xAA0088 # Purple
18+
TEXT_COLOR = 0xFFFF00
19+
20+
display = board.DISPLAY
21+
22+
# Make the display context
23+
splash = displayio.Group()
24+
display.root_group = splash
25+
26+
color_bitmap = displayio.Bitmap(display.width, display.height, 1)
27+
color_palette = displayio.Palette(1)
28+
color_palette[0] = BACKGROUND_COLOR
29+
30+
bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
31+
splash.append(bg_sprite)
32+
33+
# Draw a smaller inner rectangle
34+
inner_bitmap = displayio.Bitmap(
35+
display.width - BORDER * 2, display.height - BORDER * 2, 1
36+
)
37+
inner_palette = displayio.Palette(1)
38+
inner_palette[0] = FOREGROUND_COLOR
39+
inner_sprite = displayio.TileGrid(
40+
inner_bitmap, pixel_shader=inner_palette, x=BORDER, y=BORDER
41+
)
42+
splash.append(inner_sprite)
43+
44+
# Draw a label
45+
text = "Hello World!"
46+
text_area = label.Label(terminalio.FONT, text=text, color=TEXT_COLOR)
47+
text_width = text_area.bounding_box[2] * FONTSCALE
48+
text_group = displayio.Group(
49+
scale=FONTSCALE,
50+
x=display.width // 2 - text_width // 2,
51+
y=display.height // 2,
52+
)
53+
text_group.append(text_area) # Subgroup for text scaling
54+
splash.append(text_group)
55+
56+
while True:
57+
pass

0 commit comments

Comments
 (0)