File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -41,4 +41,7 @@ static const uint8_t D8 = 19;
4141static const uint8_t D9 = 20 ;
4242static const uint8_t D10 = 18 ;
4343
44+ static const uint8_t WIFI_ENABLE = 3 ;
45+ static const uint8_t WIFI_ANT_CONFIG = 14 ;
46+
4447#endif /* Pins_Arduino_h */
Original file line number Diff line number Diff line change 1+ /*
2+ *By setting the WIFI_ENABLE and WIFI_ANT_CONFIG pins,
3+ *
4+ *the XIAO_ESP32C6 will turn on the on-board antenna by default after power-on
5+ *
6+ *https://wiki.seeedstudio.com/xiao_esp32c6_getting_started/
7+ */
8+
9+ #include " esp32-hal-gpio.h"
10+ #include " pins_arduino.h"
11+
12+ extern " C" {
13+
14+ void initVariant (void ) {
15+ pinMode (WIFI_ENABLE, OUTPUT);
16+ digitalWrite (WIFI_ENABLE, LOW); // turn on this function
17+
18+ pinMode (WIFI_ANT_CONFIG, OUTPUT);
19+ digitalWrite (WIFI_ANT_CONFIG, LOW); // use built-in antenna, set HIGH to use external antenna
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments