Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Simple code to check WiFi Firmware on Arduino Uno R4 WiFi
- Wi-Fi support is enabled via the built-in WiFiS3 library that is shipped
- with the Arduino UNO R4 Core.
- Installing the core automatically installs the WiFiS3 library.
- ref: UNO R4 WiFi Network Examples
- https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples
- */
- #include <WiFiS3.h>
- void setup() {
- delay(500);
- //Initialize serial and wait for port to open:
- Serial.begin(9600);
- while (!Serial) {
- ; // wait for serial port to connect. Needed for native USB port only
- }
- delay(500);
- Serial.println("- Check Arduino Uno R4 WiFi firmware version -");
- // check for the WiFi module:
- if (WiFi.status() == WL_NO_MODULE) {
- Serial.println("Communication with WiFi module failed!");
- // don't continue
- while (true);
- }
- String fv = WiFi.firmwareVersion();
- Serial.println("Your WiFi firmware version is:");
- Serial.println(fv);
- Serial.println();
- if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
- Serial.println("Please upgrade the firmware");
- Serial.println(WIFI_FIRMWARE_LATEST_VERSION);
- }
- else{
- Serial.println("It's the latest version.");
- }
- }
- void loop() {
- // put your main code here, to run repeatedly:
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement