Skip to content

Commit 81c387c

Browse files
authored
Merge pull request #1955 from ladyada/master
try generating a factory selftest
2 parents 8876427 + e26491d commit 81c387c

5 files changed

Lines changed: 82 additions & 10 deletions

File tree

Adafruit_Prop_Maker_FeatherWing/Prop_Maker_LED_Simpletest/Prop_Maker_LED_Simpletest.ino

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,21 @@
3636
#define RED_LED 9
3737
#define GREEN_LED 6
3838
#define BLUE_LED 5
39+
#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
40+
#define POWER_PIN 10
41+
#define RED_LED 0
42+
#define GREEN_LED 1
43+
#define BLUE_LED 2
44+
#define RED_PIN 11
45+
#define GREEN_PIN 12
46+
#define BLUE_PIN 13
47+
#define analogWrite ledcWrite
3948
#elif defined(ESP32)
4049
#define POWER_PIN 33
41-
#define RED_LED 0
42-
#define GREEN_LED 1
43-
#define BLUE_LED 2
44-
#define RED_PIN 27
50+
#define RED_LED 0
51+
#define GREEN_LED 1
52+
#define BLUE_LED 2
53+
#define RED_PIN 27
4554
#define GREEN_PIN 12
4655
#define BLUE_PIN 13
4756
#define analogWrite ledcWrite
@@ -59,16 +68,17 @@ void setup() {
5968
digitalWrite(POWER_PIN, LOW);
6069

6170
// Set up the LED Pins
62-
pinMode(RED_LED, OUTPUT);
63-
pinMode(GREEN_LED, OUTPUT);
64-
pinMode(BLUE_LED, OUTPUT);
65-
#if defined(ESP32)
71+
#if defined(ESP32) // and ESP32-S2!
6672
ledcSetup(RED_LED, 5000, 8);
6773
ledcAttachPin(RED_PIN, RED_LED);
6874
ledcSetup(GREEN_LED, 5000, 8);
6975
ledcAttachPin(GREEN_PIN, GREEN_LED);
7076
ledcSetup(BLUE_LED, 5000, 8);
7177
ledcAttachPin(BLUE_PIN, BLUE_LED);
78+
#else
79+
pinMode(RED_LED, OUTPUT);
80+
pinMode(GREEN_LED, OUTPUT);
81+
pinMode(BLUE_LED, OUTPUT);
7282
#endif
7383

7484
analogWrite(RED_LED, 0);
@@ -104,5 +114,5 @@ void loop()
104114
analogWrite(RED_LED, red);
105115
analogWrite(GREEN_LED, green);
106116
analogWrite(BLUE_LED, blue);
107-
delay(100);
117+
delay(2);
108118
}

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)