Article directory
0. Learning video
Mainly watching the video of an old man on Youtube, which is lively, interesting and instructive;
address: https://www.youtube.com/playlist?list=PLGs0VKk2DiYw-L-RibttcvK-WBZm8WLEP
1. Install the Arduino IDE
Official website address: https://www.arduino.cc/en/software
2. Configure IDE
Insert the Arduino hardware device, select the board type, processor chip, port according to the configuration
3. Arduino code structure
Open the Arduino IDE, there are two functions by default: setup, loop
- setup refers to the content executed when the board is started, and it is executed only once, generally writing pin configuration or parameter initialization;
- loop is an infinite loop, and the content of this function will be executed after the setup is executed;
in addition, the arduino IDE also comes with many examples for learning
4. Common functions
Click Help-Reference to open the official document, commonly used arduino internal functions and variables are available
5. Write code
After writing the code, click the second icon to compile the code and burn it into the board;
6. View the output value
Click the icon in the upper right corner to view the return value in the serial port, or send data to the serial port;
of course, the premise is that there are sending and receiving programs in the code;