Skip to content

Commit 243195a

Browse files
authored
Merge pull request #1966 from ladyada/main
fix & tft factory test
2 parents e4cf263 + e5f3cbf commit 243195a

File tree

6 files changed

+113
-2
lines changed

6 files changed

+113
-2
lines changed

.github/workflows/githubci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
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", "qt2040_trinkey", "qtpy_m0", "rotarytrinkey_m0", "slidetrinkey_m0", "trinket_m0", "uno", "trinket_5v", "ledglasses_nrf52840" ]
10+
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", "qt2040_trinkey", "qtpy_m0", "qtpy_esp32s2", "rotarytrinkey_m0", "slidetrinkey_m0", "trinket_m0", "uno", "trinket_5v", "ledglasses_nrf52840" ]
1111
runs-on: ubuntu-18.04
1212

1313
steps:
@@ -35,6 +35,7 @@ jobs:
3535
git clone --quiet https://github.com/me-no-dev/ESPAsyncTCP /home/runner/Arduino/libraries/ESPAsyncTCP
3636
git clone --quiet https://github.com/adafruit/Talkie /home/runner/Arduino/libraries/Talkie
3737
git clone --quiet https://github.com/Infineon/arduino-optiga-trust-m /home/runner/Arduino/libraries/arduinoOptigaTrustM
38+
git clone --quiet https://github.com/adafruit/HID /home/runner/Arduino/libraries/HID_Project
3839
3940
- name: test platforms
4041
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }}

Adafruit_ESP32_Arduino_Demos/streaming_podcast_player/streaming_podcast_player.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,4 +285,5 @@ bool splitURL(String url, char **host, int *port, char **path){
285285
}
286286
*path = (char *)malloc(url.length()+1);
287287
url.toCharArray(*path, url.length()+1);
288+
return true;
288289
}
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
#include <Arduino.h>
2+
#include "Adafruit_LC709203F.h"
3+
#include <Adafruit_NeoPixel.h>
4+
#include "Adafruit_TestBed.h"
5+
#include <Adafruit_BME280.h>
6+
#include <Adafruit_ST7789.h>
7+
#include <Fonts/FreeSans12pt7b.h>
8+
9+
Adafruit_BME280 bme; // I2C
10+
bool bmefound = false;
11+
extern Adafruit_TestBed TB;
12+
13+
Adafruit_LC709203F lc;
14+
Adafruit_ST7789 display = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);
15+
16+
GFXcanvas16 canvas(240, 135);
17+
18+
void setup() {
19+
Serial.begin(115200);
20+
// while (! Serial) delay(10);
21+
22+
delay(100);
23+
24+
// turn on the TFT / I2C power supply
25+
pinMode(TFT_I2C_POWER, OUTPUT);
26+
digitalWrite(TFT_I2C_POWER, HIGH);
27+
28+
pinMode(NEOPIXEL_POWER, OUTPUT);
29+
digitalWrite(NEOPIXEL_POWER, HIGH);
30+
delay(10);
31+
32+
TB.neopixelPin = PIN_NEOPIXEL;
33+
TB.neopixelNum = 1;
34+
TB.begin();
35+
TB.setColor(WHITE);
36+
37+
display.init(135, 240); // Init ST7789 240x135
38+
display.setRotation(3);
39+
canvas.setFont(&FreeSans12pt7b);
40+
canvas.setTextColor(ST77XX_WHITE);
41+
42+
if (!lc.begin()) {
43+
Serial.println(F("Couldnt find Adafruit LC709203F?\nMake sure a battery is plugged in!"));
44+
while (1);
45+
}
46+
47+
Serial.println("Found LC709203F");
48+
Serial.print("Version: 0x"); Serial.println(lc.getICversion(), HEX);
49+
lc.setPackSize(LC709203F_APA_500MAH);
50+
51+
if (TB.scanI2CBus(0x77)) {
52+
Serial.println("BME280 address");
53+
54+
unsigned status = bme.begin();
55+
if (!status) {
56+
Serial.println("Could not find a valid BME280 sensor, check wiring, address, sensor ID!");
57+
Serial.print("SensorID was: 0x"); Serial.println(bme.sensorID(),16);
58+
Serial.print(" ID of 0xFF probably means a bad address, a BMP 180 or BMP 085\n");
59+
Serial.print(" ID of 0x56-0x58 represents a BMP 280,\n");
60+
Serial.print(" ID of 0x60 represents a BME 280.\n");
61+
Serial.print(" ID of 0x61 represents a BME 680.\n");
62+
return;
63+
}
64+
Serial.println("BME280 found OK");
65+
bmefound = true;
66+
}
67+
}
68+
69+
uint8_t j = 0;
70+
71+
void loop() {
72+
Serial.println("**********************");
73+
74+
TB.printI2CBusScan();
75+
76+
if (j % 5 == 0) {
77+
canvas.fillScreen(ST77XX_BLACK);
78+
canvas.setCursor(0, 25);
79+
canvas.setTextColor(ST77XX_RED);
80+
canvas.println("Adafruit Feather");
81+
canvas.setTextColor(ST77XX_YELLOW);
82+
canvas.println("ESP32-S2 TFT Demo");
83+
canvas.setTextColor(ST77XX_GREEN);
84+
canvas.print("Battery: ");
85+
canvas.setTextColor(ST77XX_WHITE);
86+
canvas.print(lc.cellVoltage(), 1);
87+
canvas.print(" V / ");
88+
canvas.print(lc.cellPercent(), 0);
89+
canvas.println("%");
90+
canvas.setTextColor(ST77XX_BLUE);
91+
canvas.print("I2C: ");
92+
canvas.setTextColor(ST77XX_WHITE);
93+
for (uint8_t a=0x01; a<=0x7F; a++) {
94+
if (TB.scanI2CBus(a, 0)) {
95+
canvas.print("0x");
96+
canvas.print(a, HEX);
97+
canvas.print(", ");
98+
}
99+
}
100+
display.drawRGBBitmap(0, 0, canvas.getBuffer(), 240, 135);
101+
pinMode(TFT_BACKLITE, OUTPUT);
102+
digitalWrite(TFT_BACKLITE, HIGH);
103+
}
104+
105+
TB.setColor(TB.Wheel(j++));
106+
delay(10);
107+
return;
108+
}

Trinket_Ultrasonic_Rangefinder/Trinket_Ultrasonic_Rangefinder.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,5 @@ uint16_t mode(uint16_t *x,int n){
116116
}
117117
return mode;
118118
}
119+
return 0;
119120
}

library.deps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
depends=Adafruit ILI9341, Adafruit BusIO, SD, Adafruit NeoPixel, Adafruit VS1053 Library, Adafruit BluefruitLE nRF51, Adafruit seesaw Library, Ethernet, Adafruit IO Arduino, FastLED, Adafruit LiquidCrystal, Adafruit SoftServo, TinyWireM, Adafruit AM radio library, WaveHC, Adafruit LED Backpack Library, MAX31850 OneWire, Adafruit VC0706 Serial Camera Library, RTClib, Adafruit SleepyDog Library, Adafruit Thermal Printer Library, Adafruit Zero I2S Library, Adafruit EPD, Adafruit SSD1351 library, Adafruit FONA Library, Adafruit Motor Shield V2 Library, Adafruit NeoMatrix, Adafruit Soundboard library, Adafruit Circuit Playground, ArduinoJson, Adafruit TCS34725, Adafruit Pixie, Adafruit GPS Library, TinyGPS, WiFi101, Adafruit DotStar, Adafruit Si7021 Library, Adafruit WS2801 Library, Mouse, Keyboard, Time, IRremote, Adafruit LSM9DS0 Library, Adafruit Arcada Library, MIDIUSB, PubSubClient, Adafruit LIS2MDL, Adafruit NeoPXL8, Adafruit MCP23017 Arduino Library, Adafruit MLX90640, LiquidCrystal, Adafruit NeoTrellis M4 Library, RGB matrix Panel, Adafruit MLX90614 Library, Adafruit RGB LCD Shield Library, MAX6675 library, Adafruit MP3, Adafruit Keypad, Adafruit Arcada GifDecoder, Keypad, Neosegment, Encoder, Adafruit TiCoServo, Adafruit Trellis Library, FauxmoESP, Adafruit LSM303 Accel, Adafruit LSM303DLH Mag, Adafruit LSM303DLHC, CapacitiveSensor, Adafruit Zero PDM Library, Adafruit DMA neopixel library, elapsedMillis, DST RTC, Adafruit SHARP Memory Display, Adafruit SPIFlash, BSEC Software Library, WiiChuck, Adafruit DPS310, Adafruit AHTX0, RotaryEncoder, Adafruit MCP9808 Library, LSM303, Adafruit Protomatter, HID-Project, Adafruit IS31FL3741 Library, Sensirion I2C SCD4x, Adafruit TestBed
1+
depends=Adafruit ILI9341, Adafruit BusIO, SD, Adafruit NeoPixel, Adafruit VS1053 Library, Adafruit BluefruitLE nRF51, Adafruit seesaw Library, Ethernet, Adafruit IO Arduino, FastLED, Adafruit LiquidCrystal, Adafruit SoftServo, TinyWireM, Adafruit AM radio library, WaveHC, Adafruit LED Backpack Library, MAX31850 OneWire, Adafruit VC0706 Serial Camera Library, RTClib, Adafruit SleepyDog Library, Adafruit Thermal Printer Library, Adafruit Zero I2S Library, Adafruit EPD, Adafruit SSD1351 library, Adafruit FONA Library, Adafruit Motor Shield V2 Library, Adafruit NeoMatrix, Adafruit Soundboard library, Adafruit Circuit Playground, ArduinoJson, Adafruit TCS34725, Adafruit Pixie, Adafruit GPS Library, TinyGPS, WiFi101, Adafruit DotStar, Adafruit Si7021 Library, Adafruit WS2801 Library, Mouse, Keyboard, Time, IRremote, Adafruit LSM9DS0 Library, Adafruit Arcada Library, MIDIUSB, PubSubClient, Adafruit LIS2MDL, Adafruit NeoPXL8, Adafruit MCP23017 Arduino Library, Adafruit MLX90640, LiquidCrystal, Adafruit NeoTrellis M4 Library, RGB matrix Panel, Adafruit MLX90614 Library, Adafruit RGB LCD Shield Library, MAX6675 library, Adafruit MP3, Adafruit Keypad, Adafruit Arcada GifDecoder, Keypad, Neosegment, Encoder, Adafruit TiCoServo, Adafruit Trellis Library, FauxmoESP, Adafruit LSM303 Accel, Adafruit LSM303DLH Mag, Adafruit LSM303DLHC, CapacitiveSensor, Adafruit Zero PDM Library, Adafruit DMA neopixel library, elapsedMillis, DST RTC, Adafruit SHARP Memory Display, Adafruit SPIFlash, BSEC Software Library, WiiChuck, Adafruit DPS310, Adafruit AHTX0, RotaryEncoder, Adafruit MCP9808 Library, LSM303, Adafruit Protomatter, Adafruit IS31FL3741 Library, Sensirion I2C SCD4x, Adafruit TestBed
22

0 commit comments

Comments
 (0)