With arduino-esp32 2.0.3, ESP32-S3 support added now. (~release notice)
To install arduino-esp32 to Arduino IDE:
(Install arduino-esp32 2 on Arduino IDE, to program ESP32-C3/S2/S3)
In MENU > File > Preference, make sure "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json" is added in Additional Board Manager URLs field.
In MENU > Tools > Board > Boards Manager...
Now you can search and install for "esp32 by Espressif Systems"
Then you can select ESP32S3 Dev Module
Try run on NodeMCU ESP-S3-12K-Kit
ESP32S3_info.ino, get ESP info.
#include <Esp.h>
void setup() {
delay(500);
Serial.begin(115200);
delay(500);
Serial.println("\n\n================================");
Serial.printf("Chip Model: %s\n", ESP.getChipModel());
Serial.printf("Chip Revision: %d\n", ESP.getChipRevision());
Serial.printf("with %d core\n", ESP.getChipCores());
Serial.printf("Flash Chip Size : %d \n", ESP.getFlashChipSize());
Serial.printf("Flash Chip Speed : %d \n", ESP.getFlashChipSpeed());
esp_chip_info_t chip_info;
esp_chip_info(&chip_info);
Serial.printf("\nFeatures included:\n %s\n %s\n %s\n %s\n %s\n",
(chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded flash" : "",
(chip_info.features & CHIP_FEATURE_WIFI_BGN) ? "2.4GHz WiFi" : "",
(chip_info.features & CHIP_FEATURE_BLE) ? "Bluetooth LE" : "",
(chip_info.features & CHIP_FEATURE_BT) ? "Bluetooth Classic" : "",
(chip_info.features & CHIP_FEATURE_IEEE802154) ? "IEEE 802.15.4" : "");
Serial.println();
Serial.println();
Serial.println("\n- end of setup() -");
}
void loop() {
// put your main code here, to run repeatedly:
}
ESP32S3_pins.ino, list pins with pre-defined function.
void setup() {
// put your setup code here, to run once:
delay(500);
Serial.begin(115200);
delay(500);
Serial.println("\n\n================================");
Serial.printf("Chip Model: %s %s %d\n",
ESP.getChipModel(),
"rev.",
(int)ESP.getChipRevision());
Serial.printf("with number of cores = %d\n", (int)ESP.getChipCores());
Serial.println("================================");
#ifdef EXTERNAL_NUM_INTERRUPTS
Serial.printf("EXTERNAL_NUM_INTERRUPTS = %d\n", EXTERNAL_NUM_INTERRUPTS);
#endif
#ifdef NUM_DIGITAL_PINS
Serial.printf("NUM_DIGITAL_PINS = %d\n", NUM_DIGITAL_PINS);
#endif
#ifdef NUM_ANALOG_INPUTS
Serial.printf("NUM_ANALOG_INPUTS = %d\n", NUM_ANALOG_INPUTS);
#endif
Serial.println();
Serial.printf("Default TX: %d\n", TX);
Serial.printf("Default RX: %d\n", RX);
Serial.println();
Serial.printf("Default SDA: %d\n", SDA);
Serial.printf("Default SCL: %d\n", SCL);
Serial.println();
Serial.printf("Default SS: %d\n", SS);
Serial.printf("Default MOSI: %d\n", MOSI);
Serial.printf("Default MISO: %d\n", MISO);
Serial.printf("Default SCK: %d\n", SCK);
Serial.println();
Serial.printf("A0\tA1\tA2\tA3\tA4\tA5\tA6\tA7\tA8\tA9\n");
Serial.printf("%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n",
A0, A1, A2, A3, A4, A5, A6, A7, A8, A9);
Serial.println();
Serial.printf("A10\tA11\tA12\tA13\tA14\tA15\tA16\tA17\tA18\tA19\n");
Serial.printf("%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n",
A10, A11, A12, A13, A14, A15, A16, A17, A18, A19);
Serial.println();
Serial.printf("T1\tT2\tT3\tT4\tT5\tT6\tT7\tT8\tT9\tT10\n");
Serial.printf("%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n",
T1, T2, T3, T4, T5, T6, T7, T8, T9, T10);
Serial.println();
Serial.printf("T11\tT12\tT13\tT14\n");
Serial.printf("%d\t%d\t%d\t%d\n",
T11, T12, T13, T14);
Serial.println("================================");
}
void loop() {
// put your main code here, to run repeatedly:
}
ESP32S3_RGB.ino, control ESP-S3-12K-Kit on-board RGB LED.
#define LED_R 5
#define LED_G 6
#define LED_B 7
void setup() {
delay(500);
Serial.begin(115200);
delay(500);
pinMode(LED_R, OUTPUT);
pinMode(LED_G, OUTPUT);
pinMode(LED_B, OUTPUT);
digitalWrite(LED_R, LOW);
digitalWrite(LED_G, LOW);
digitalWrite(LED_B, LOW);
delay(1000);
digitalWrite(LED_R, HIGH);
digitalWrite(LED_G, HIGH);
digitalWrite(LED_B, HIGH);
delay(1000);
digitalWrite(LED_R, LOW);
digitalWrite(LED_G, LOW);
digitalWrite(LED_B, LOW);
delay(1000);
}
void loop() {
digitalWrite(LED_R, HIGH);
delay(2000);
digitalWrite(LED_R, LOW);
digitalWrite(LED_G, HIGH);
delay(2000);
digitalWrite(LED_G, LOW);
digitalWrite(LED_B, HIGH);
delay(2000);
digitalWrite(LED_B, LOW);
delay(2000);
}
more exercise of ESP32-S3 (arduino-esp32):
No comments:
Post a Comment