Arduino UNO R3 SMD ATmega328 Compatible Board Documentation
The Arduino UNO R3 SMD ATmega328 Compatible Board is a microcontroller board based on the popular Arduino Uno platform. It features the ATmega328 microcontroller, a USB interface, and a range of digital and analog input/output pins. This board is compatible with the Arduino IDE and is suitable for a wide range of IoT projects.
Microcontroller: ATmega328
Operating Voltage: 5V
Input Voltage: 7-12V
Digital I/O Pins: 14
Analog Input Pins: 6
Flash Memory: 32 KB
SRAM: 2 KB
EEPROM: 1 KB
### Example 1: Blinking LED
This example demonstrates how to use the Arduino UNO R3 SMD ATmega328 Compatible Board to blink an LED connected to digital pin 13.
```c
const int ledPin = 13; // Choose the pin for the LED
void setup() {
pinMode(ledPin, OUTPUT); // Set the pin as an output
}
void loop() {
digitalWrite(ledPin, HIGH); // Turn the LED on
delay(1000); // Wait for 1 second
digitalWrite(ledPin, LOW); // Turn the LED off
delay(1000); // Wait for 1 second
}
```
### Example 2: Reading Analog Sensor Values
This example demonstrates how to use the Arduino UNO R3 SMD ATmega328 Compatible Board to read analog sensor values from a potentiometer connected to analog pin A0.
```c
const int sensorPin = A0; // Choose the pin for the sensor
void setup() {
Serial.begin(9600); // Initialize the serial communication
}
void loop() {
int sensorValue = analogRead(sensorPin); // Read the sensor value
Serial.print("Sensor Value: ");
Serial.println(sensorValue); // Print the sensor value to the serial monitor
delay(1000); // Wait for 1 second
}
```
### Example 3: Communicating with a Serial Device
This example demonstrates how to use the Arduino UNO R3 SMD ATmega328 Compatible Board to communicate with a serial device, such as a GPS module, connected to the serial pins (RX and TX).
```c
void setup() {
Serial.begin(9600); // Initialize the serial communication
}
void loop() {
if (Serial.available() > 0) {
String data = Serial.readStringUntil('
'); // Read the incoming data
Serial.print("Received: ");
Serial.println(data); // Print the received data to the serial monitor
}
delay(1000); // Wait for 1 second
}
```
Note: These code examples are for illustration purposes only and may require modifications to suit your specific project requirements.