Study notes-Arduino Uno R3 (1)

Some words written in the main text have not been
seen for a long time. Since I was preparing for postgraduate exams last year, I have not had time to continue learning 51 and 32. The current stage is looking for internships and graduation projects. When choosing the topic, I chose "Gesture Control Car Based on Arduino Uno". Taking advantage of the holiday, I bought a R3 board and related kits.

Text
Arduino UNO is the best choice for getting started with Arduino
1. Power supply: UNO has three power supply methods

Input form Voltage
DC 7-12V
USB 5V
5V / VIN The power supply at the 5V port must be 5V
The power supply at the VIN port must be 7-12V

2. Indicator light

Pin number Types of
ON Power Indicator
TX Serial port sending indicator
RX Serial port receiving indicator
L Programmable control indicator

3. Reset button
Press this button to restart the Arduino and run the program from the beginning

4. Storage space The storage space of
Arduino is the storage space integrated by its main control chip. The storage space of Arduino can also be expanded by means of peripheral chips.

Storage space type capacity
Flash 32KB
SHAME 2KB
EEPROM 1KB

5. Input and output port
UART communication: RX and TX pins are used to receive and send serial data. These two pins are connected to ATmega16U2 for serial communication with the computer.

External interrupt: 2 and 3 pins, can input external interrupt signal

PWM output: 3, 5, 6, 10, 11 pins, which can be used to output PWM waves

SPI communication: SS, MOSI, MISO, SCK pins. Can be used for SPI communication

TWI communication: SDA, SCL pin and TWI interface, can be used for TWI communication, compatible with IIC

AREF: input port for analog input reference voltage

RESET: When connected to a low level, the Arduino will be reset. When the reset button is pressed, the port will be connected to a low level to reset the Arduino.

You can find more information about Arduino uno and download the latest schematic and PCB files at http://arduino.cc/en/Main/ArduinoBoardUno.

For the first experiment,
first open the IDE software, you will see this interface, waiting to enter the main interface
Insert picture description here

Then select "File"-"Example"-01.basic-Blink, the following code will appear on the pop-up routine page:

/*
  Blink

  Turns an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
  it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
  the correct LED pin independent of which board is used.
  If you want to know what pin the on-board LED is connected to on your Arduino
  model, check the Technical Specs of your board at:
  https://www.arduino.cc/en/Main/Products

  modified 8 May 2014
  by Scott Fitzgerald
  modified 2 Sep 2016
  by Arturo Guadalupi
  modified 8 Sep 2016
  by Colby Newman

  This example code is in the public domain.

  http://www.arduino.cc/en/Tutorial/Blink
*/

// the setup function runs once when you press reset or power the board
void setup() {
    
    
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
    
    
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

This is actually a simple small program that controls the blinking of the LED lights. When we are learning 51 and 32, the first routine is generally related to lighting.
The next step is to burn the program into the board. Since the UNO driver can be used when connected to a computer, I won't talk about it here. Before downloading, first select the model of the corresponding development board in "Tools"-Development Board-Arduino uno.
Insert picture description here
My habit is to compile and download the program first, regardless of whether the program is written by myself or a routine. To compile, click the "√" under the toolbar, and download the "→" under the motor toolbar. When we see such a page, it means that the program has been downloaded successfully.
Insert picture description here
Let's look at the development board now. The LED at L is already on, and it lights up every second.
Insert picture description here
In the process of preparing software materials before studying, because the official website of the IDE is abroad, it is very slow to board if there is no VPN in China, so I attach the connection of Baidu Cloud here, and pick it up if necessary:

The link is permanent and valid. If you hang up, leave a message in the comments or private chat.
Link: https://pan.baidu.com/s/1wP3eedekArU8stBOMWB7bA
Extraction code: 0t7i

Guess you like

Origin blog.csdn.net/weixin_41679822/article/details/112425046