This commit is contained in:
Serge NOEL
2026-02-10 11:27:18 +01:00
parent 549c9f388e
commit 4423bb2de1
175 changed files with 238087 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch

View File

@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

View File

@@ -0,0 +1,14 @@
[env]
platform = espressif32
framework = arduino
monitor_speed = 115200
monitor_filters = colorize, esp32_exception_decoder
upload_speed = 460800
build_type = debug
lib_deps =
adafruit/Adafruit NeoPixel @ ^1.11.0
[env:esp32-dev-board]
board = lolin_c3_mini
build_flags =
-D SERIAL_BAUD=115200

View File

@@ -0,0 +1,32 @@
#include <Arduino.h>
#include <Adafruit_NeoPixel.h>
#include <Ticker.h>
#define PIN_LED 8
#define LED_COUNT 1
Adafruit_NeoPixel pixels(LED_COUNT, PIN_LED, NEO_GRB + NEO_KHZ800);
Ticker tOn, tOff;
void setup()
{
Serial.begin(SERIAL_BAUD);
Serial.println(F("Hello,"));
Serial.println(F("I'm"));
Serial.println(F("ESP32-C3!"));
tOn.attach_ms(500, [](){
pixels.setPixelColor(0, pixels.Color(0, 150, 0));
pixels.show();
});
delay(250);
tOff.attach_ms(500, [](){
pixels.setPixelColor(0, pixels.Color(0, 0, 0));
pixels.show();
Serial.printf("[%ld] %#08lx\n", millis(), random());
});
}
void loop(){}

View File

@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch

View File

@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

View File

@@ -0,0 +1,12 @@
[env]
platform = espressif32
framework = arduino
monitor_speed = 115200
monitor_filters = colorize, esp32_exception_decoder
upload_speed = 460800
build_type = debug
[env:esp32-dev-board]
board = lolin_c3_mini
build_flags =
-D SERIAL_BAUD=115200

View File

@@ -0,0 +1,89 @@
#include <Arduino.h>
#include "WiFi.h"
void setup()
{
Serial.begin(SERIAL_BAUD);
Serial.println(F("Hello,"));
Serial.println(F("I'm"));
Serial.println(F("ESP32-C3!"));
// Set WiFi to station mode and disconnect from an AP if it was previously connected.
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
Serial.println("Setup done");
}
void loop()
{
Serial.println("Scan start");
// WiFi.scanNetworks will return the number of networks found.
int n = WiFi.scanNetworks();
Serial.println("Scan done");
if (n == 0)
{
Serial.println("no networks found");
}
else
{
Serial.print(n);
Serial.println(" networks found");
Serial.println("Nr | SSID | RSSI | CH | Encryption");
for (int i = 0; i < n; ++i)
{
// Print SSID and RSSI for each network found
Serial.printf("%2d", i + 1);
Serial.print(" | ");
Serial.printf("%-32.32s", WiFi.SSID(i).c_str());
Serial.print(" | ");
Serial.printf("%4d", WiFi.RSSI(i));
Serial.print(" | ");
Serial.printf("%2d", WiFi.channel(i));
Serial.print(" | ");
switch (WiFi.encryptionType(i))
{
case WIFI_AUTH_OPEN:
Serial.print("open");
break;
case WIFI_AUTH_WEP:
Serial.print("WEP");
break;
case WIFI_AUTH_WPA_PSK:
Serial.print("WPA");
break;
case WIFI_AUTH_WPA2_PSK:
Serial.print("WPA2");
break;
case WIFI_AUTH_WPA_WPA2_PSK:
Serial.print("WPA+WPA2");
break;
case WIFI_AUTH_WPA2_ENTERPRISE:
Serial.print("WPA2-EAP");
break;
case WIFI_AUTH_WPA3_PSK:
Serial.print("WPA3");
break;
case WIFI_AUTH_WPA2_WPA3_PSK:
Serial.print("WPA2+WPA3");
break;
case WIFI_AUTH_WAPI_PSK:
Serial.print("WAPI");
break;
default:
Serial.print("unknown");
}
Serial.println();
delay(10);
}
}
Serial.println("");
// Delete the scan result to free memory for code below.
WiFi.scanDelete();
// Wait a bit before scanning again.
delay(5000);
}