/* * ============================================================ * Tishvi ESP32-C3 Super Mini — Getting Started Sketch * guide.tishvi.com * ============================================================ * Chip : ESP32-C3 (RISC-V, single core, 160 MHz max) * Bluetooth: BLE 5.0 ONLY — no Classic Bluetooth * * ⚠ CRITICAL — Before uploading, set in Arduino IDE: * Tools → Board → ESP32C3 Dev Module * Tools → USB CDC On Boot → Enabled * Tools → Upload Speed → 921600 * * Without "USB CDC On Boot → Enabled", Serial will not * output anything in the Serial Monitor. * * Built-in LED: GPIO 8 * Note: On many C3 Super Mini boards the LED is active-LOW * (HIGH = off, LOW = on). The sketch handles both. * * No external libraries needed — WiFi.h is included with the * ESP32 board package from Espressif. * ============================================================ */ #include // ── Pin Definitions ────────────────────────────────────────── const int LED_PIN = 8; // Built-in LED — GPIO 8 // Some C3 Super Mini boards have an active-LOW LED. // If the LED stays ON and turns OFF when blinking, set this to false. // If the LED stays OFF and turns ON when blinking, set this to true. const bool LED_ACTIVE_HIGH = false; // Most Super Mini boards: active-LOW // ── Helpers ────────────────────────────────────────────────── void ledOn() { digitalWrite(LED_PIN, LED_ACTIVE_HIGH ? HIGH : LOW); } void ledOff() { digitalWrite(LED_PIN, LED_ACTIVE_HIGH ? LOW : HIGH); } // ── Setup ──────────────────────────────────────────────────── void setup() { Serial.begin(115200); delay(1000); // Allow USB CDC time to enumerate after power-on pinMode(LED_PIN, OUTPUT); ledOff(); Serial.println("\n========================================"); Serial.println(" Tishvi ESP32-C3 Super Mini"); Serial.println("========================================"); Serial.printf("Chip Model : %s\n", ESP.getChipModel()); Serial.printf("Architecture: RISC-V (%d core)\n", ESP.getChipCores()); Serial.printf("CPU Speed : %d MHz\n", ESP.getCpuFreqMHz()); Serial.printf("Flash Size : %d MB\n", ESP.getFlashChipSize() / 1048576); Serial.printf("Free Heap : %d bytes\n", ESP.getFreeHeap()); Serial.printf("MAC Address : %s\n", WiFi.macAddress().c_str()); Serial.println("Bluetooth : BLE 5.0 only (no Classic BT)"); Serial.println("========================================\n"); // ── WiFi Network Scan ──────────────────────────────────── WiFi.mode(WIFI_STA); WiFi.disconnect(); delay(100); Serial.println("Scanning for WiFi networks (2.4 GHz only)..."); int n = WiFi.scanNetworks(); if (n == 0) { Serial.println("No networks found. Check antenna / placement."); } else { Serial.printf("%d network(s) found:\n\n", n); for (int i = 0; i < n; i++) { Serial.printf(" %2d. %-28s %4d dBm %s\n", i + 1, WiFi.SSID(i).c_str(), WiFi.RSSI(i), WiFi.encryptionType(i) == WIFI_AUTH_OPEN ? "[Open]" : "[Secured]" ); delay(10); } } WiFi.scanDelete(); Serial.println("\nBuilt-in LED (GPIO 8) blinking every 500 ms."); Serial.println("If LED does not blink: flip LED_ACTIVE_HIGH in sketch."); } // ── Loop ───────────────────────────────────────────────────── void loop() { ledOn(); delay(500); ledOff(); delay(500); }