add feathers
This commit is contained in:
parent
6554073867
commit
46f99aaeac
1 changed files with 34 additions and 8 deletions
|
|
@ -18,13 +18,37 @@
|
|||
#include <SPI.h>
|
||||
#include <WiFiNINA.h>
|
||||
|
||||
// Configure the pins used for the ESP32 connection
|
||||
#define SPIWIFI SPI // The SPI port
|
||||
#define SPIWIFI_SS 10 // Chip select pin
|
||||
#define SPIWIFI_ACK 7 // a.k.a BUSY or READY pin
|
||||
#define ESP32_RESETN 5 // Reset pin
|
||||
#define ESP32_GPIO0 -1 // Not connected
|
||||
// Configure the pins used for the ESP32 connection
|
||||
#if defined(ADAFRUIT_FEATHER_M4_EXPRESS) ||
|
||||
defined(ADAFRUIT_FEATHER_M0_EXPRESS) ||
|
||||
defined(ARDUINO_AVR_FEATHER32U4) ||
|
||||
defined(ARDUINO_NRF52840_FEATHER)
|
||||
#define SPIWIFI_SS 13 // Chip select pin
|
||||
#define ESP32_RESETN 12 // Reset pin
|
||||
#define SPIWIFI_ACK 11 // a.k.a BUSY or READY pin
|
||||
#define ESP32_GPIO0 10
|
||||
|
||||
#elif defined(ARDUINO_AVR_FEATHER328P)
|
||||
#define SPIWIFI SPI // The SPI port
|
||||
#define SPIWIFI_SS 4 // Chip select pin
|
||||
#define ESP32_RESETN 3 // Reset pin
|
||||
#define SPIWIFI_ACK 2 // a.k.a BUSY or READY pin
|
||||
#define ESP32_GPIO0 -1
|
||||
|
||||
#elif defined(ARDUINO_NRF52832_FEATHER )
|
||||
#define SPIWIFI SPI // The SPI port
|
||||
#define SPIWIFI_SS 16 // Chip select pin
|
||||
#define ESP32_RESETN 15 // Reset pin
|
||||
#define SPIWIFI_ACK 7 // a.k.a BUSY or READY pin
|
||||
#define ESP32_GPIO0 -1
|
||||
|
||||
#elif defined(TEENSYDUINO)
|
||||
#define SPIWIFI SPI // The SPI port
|
||||
#define SPIWIFI_SS 5 // Chip select pin
|
||||
#define ESP32_RESETN 6 // Reset pin
|
||||
#define SPIWIFI_ACK 9 // a.k.a BUSY or READY pin
|
||||
#define ESP32_GPIO0 -1
|
||||
#endif
|
||||
|
||||
void setup() {
|
||||
//Initialize serial and wait for port to open:
|
||||
|
|
@ -34,7 +58,7 @@ void setup() {
|
|||
}
|
||||
|
||||
Serial.println("WiFi Scanning test");
|
||||
|
||||
|
||||
// Set up the pins!
|
||||
WiFi.setPins(SPIWIFI_SS, SPIWIFI_ACK, ESP32_RESETN, ESP32_GPIO0, &SPIWIFI);
|
||||
|
||||
|
|
@ -44,11 +68,13 @@ void setup() {
|
|||
// don't continue
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
String fv = WiFi.firmwareVersion();
|
||||
Serial.println(fv);
|
||||
if (fv < "1.0.0") {
|
||||
Serial.println("Please upgrade the firmware");
|
||||
while (1) delay(10);
|
||||
}
|
||||
Serial.println("Firmware OK");
|
||||
|
||||
// print your MAC address:
|
||||
byte mac[6];
|
||||
|
|
|
|||
Loading…
Reference in a new issue