Original Arduino UNO R4 WIFI Documentation
The Original Arduino UNO R4 WIFI is a microcontroller board based on the ATmega328P microchip, featuring built-in WiFi capabilities. This board is a modified version of the classic Arduino UNO, with an added WiFi module, allowing for wireless communication and connectivity.
Microcontroller: ATmega328P
WiFi Module: ESP8266
Operating Frequency: 2.4 GHz
WiFi Standards: 802.11 b/g/n
Data Transfer Rate: Up to 72.2 Mbps
Flash Memory: 32 KB
SRAM: 2 KB
EEPROM: 1 KB
Digital I/O Pins: 14
Analog Input Pins: 6
DC Power Jack: Yes
USB Connection: Yes
### Example 1: Simple WiFi Connectivity
This example demonstrates how to connect to a WiFi network using the Original Arduino UNO R4 WIFI.
const char ssid = "your_ssid"; // Replace with your WiFi network SSID
const char password = "your_password"; // Replace with your WiFi network password
void setup() {
Serial.begin(9600);
// Connect to WiFi network
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
// No operation in this example
}
```
### Example 2: Sending Data to a Web Server using HTTP
This example demonstrates how to send data to a web server using the Original Arduino UNO R4 WIFI.
```cpp
#include <WiFi.h>
#include <WiFiClient.h>
const char ssid = "your_ssid"; // Replace with your WiFi network SSID
const char password = "your_password"; // Replace with your WiFi network password
const char serverUrl = "http://example.com/data"; // Replace with your server URL
void setup() {
Serial.begin(9600);
// Connect to WiFi network
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
}
void loop() {
if (client.connect(serverUrl, 80)) {
// Send HTTP request
client.println("GET " + String(serverUrl) + "?data=hello HTTP/1.1");
client.println("Host: " + String(serverUrl));
client.println("Connection: close");
client.println();
// Read server response
while (client.available()) {
char c = client.read();
Serial.write(c);
}
client.stop();
} else {
Serial.println("Connection failed");
}
### Example 3: Reading Data from a Web Server using HTTP
This example demonstrates how to read data from a web server using the Original Arduino UNO R4 WIFI.
```cpp
#include <WiFi.h>
#include <WiFiClient.h>
const char ssid = "your_ssid"; // Replace with your WiFi network SSID
const char password = "your_password"; // Replace with your WiFi network password
const char serverUrl = "http://example.com/data"; // Replace with your server URL
void setup() {
Serial.begin(9600);
// Connect to WiFi network
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
}
void loop() {
if (client.connect(serverUrl, 80)) {
// Send HTTP request
client.println("GET " + String(serverUrl) + " HTTP/1.1");
client.println("Host: " + String(serverUrl));
client.println("Connection: close");
client.println();
// Read server response
while (client.available()) {
char c = client.read();
Serial.write(c);
}
client.stop();
} else {
Serial.println("Connection failed");
}
These examples demonstrate the basic usage of the Original Arduino UNO R4 WIFI, including WiFi connectivity, sending data to a web server, and reading data from a web server.