Some updates

This commit is contained in:
2021-01-30 10:50:07 +01:00
parent dd88541135
commit eb912b8e74
13 changed files with 2765 additions and 299 deletions

View File

@ -0,0 +1,35 @@
/*
This sketch is combined demo of: 1) SD(esp_32) -- > SD_Test; 2) WiFi --> ETH_LAN8720
It displays info about the card on the terminal and initializes LAN after that. You can ping the IP address shown on the terminal.
*/
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#define ETH_PHY_POWER 12
#include <ETH.h>
static bool eth_connected = false;
void WiFiEvent(WiFiEvent_t event);
void testClient(const char * host, uint16_t port);
#define BUTTON_PRESSED() (!digitalRead (34))
void setup()
{
Serial.begin(115200);
WiFi.onEvent(WiFiEvent);
ETH.begin();
pinMode (34, INPUT); // Button
}
void loop()
{
if (BUTTON_PRESSED()) {
if (eth_connected) {
Serial.println("Button pressed");
testClient("google.com", 80);
}
delay(1000);
}
}