Skip to content

Commit 5cf97f6

Browse files
committed
try generating a factory selftest
1 parent 8876427 commit 5cf97f6

4 files changed

Lines changed: 63 additions & 1 deletion

File tree

Factory_Tests/QTPy_ESP32S2_FactoryTest/.qtpy_esp32s2.generate

Whitespace-only changes.

Factory_Tests/QTPy_ESP32S2_FactoryTest/.qtpy_esp32s2.test.only

Whitespace-only changes.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#include "WiFi.h"
2+
#include <Adafruit_TestBed.h>
3+
extern Adafruit_TestBed TB;
4+
5+
// the setup routine runs once when you press reset:
6+
void setup() {
7+
Serial.begin(115200);
8+
9+
// Set up QT port
10+
Wire1.setPins(SDA1, SCL1);
11+
12+
// TestBed will handle the neopixel swirl for us
13+
TB.neopixelPin = PIN_NEOPIXEL;
14+
TB.neopixelNum = 1;
15+
TB.begin();
16+
17+
// Set WiFi to station mode and disconnect from an AP if it was previously connected
18+
WiFi.mode(WIFI_STA);
19+
WiFi.disconnect();
20+
}
21+
22+
// the loop routine runs over and over again forever:
23+
uint8_t wheelColor=0;
24+
void loop() {
25+
if (wheelColor == 0) {
26+
// Test I2C!
27+
Serial.print("Default (pads) port ");
28+
TB.theWire = &Wire;
29+
TB.printI2CBusScan();
30+
Serial.print("Secondary (QT) port ");
31+
TB.theWire = &Wire1;
32+
TB.printI2CBusScan();
33+
34+
// Test WiFi Scan!
35+
// WiFi.scanNetworks will return the number of networks found
36+
int n = WiFi.scanNetworks();
37+
Serial.print("WiFi AP scan done...");
38+
if (n == 0) {
39+
Serial.println("no networks found");
40+
} else {
41+
Serial.print(n);
42+
Serial.println(" networks found");
43+
for (int i = 0; i < n; ++i) {
44+
// Print SSID and RSSI for each network found
45+
Serial.print(i + 1);
46+
Serial.print(": ");
47+
Serial.print(WiFi.SSID(i));
48+
Serial.print(" (");
49+
Serial.print(WiFi.RSSI(i));
50+
Serial.print(")");
51+
Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?" ":"*");
52+
delay(10);
53+
}
54+
}
55+
Serial.println("");
56+
}
57+
58+
TB.setColor(TB.Wheel(wheelColor++)); // swirl NeoPixel
59+
60+
delay(5);
61+
}

library.deps

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +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
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
2+

0 commit comments

Comments
 (0)