当前位置:网站首页>Programming learning based on ardunio ide software development
Programming learning based on ardunio ide software development
2022-07-19 06:46:00 【Salmon with lemon】
List of articles
Ardunio
Arduino It's convenient and flexible 、 Easy to use open source electronic prototype platform . Include hardware ( All kinds of Arduino plate ) And software (ArduinoIDE). By a European development team in 2005 Developed in winter . Its members include Massimo Banzi、David Cuartielles、Tom Igoe、Gianluca Martino、David Mellis and Nicholas Zambetti etc. .
It is built on open source code simple I/O Interface version , And has the use of similar Java、C Linguistic Processing/Wiring development environment . It mainly consists of two parts : The hardware part can be used for circuit connection Arduino Circuit board ; The other one is Arduino IDE, The program development environment in your computer . All you need is to be there. IDE Write program code in , Upload the program to Arduino Back of circuit board , The program will tell Arduino What does the circuit board have to do .
One 、 stay Arduino IDE Next finish STM32 Serial communication program
Download it on the official website ARDUINO IDE Software
open , Select tool —> Development board —> Development board Manager 
look for Arduino SAM Boards(32-bit ARM Cortex-M3) Installation .
wow , Erroneous ?
resolvent : Click on “ file -> Preferences ”
Something's wrong , My opening is blank .
A operation , Just can download 
The development board I use is stm32f103, Choose this 
Then link with the real object
usb Connect the serial port development board to the computer
| 1 Number | 2 Number |
|---|---|
| BOOT0 | GND |
| RXD | A9 |
| TXD | A10 |

next step , Burn program
Target program :
int flag=1;
char Stop[]="stop\n";
void setup() {
// initialization
pinMode(PB0, OUTPUT);//PB0 It's green ,PB1 For blue ,PB5 In red , It can be changed as needed
Serial.begin(115200);
}
void loop() {
int i=0,flag_s=0;
char inByte[50];
digitalWrite(PB0, HIGH); // Little lights
delay(500); // Delay
digitalWrite(PB0, LOW); // Small lights went out
delay(500); // Delay
while (Serial.available()> 0) // When the send buffer has data
{
inByte[i] = Serial.read(); // Take out and read from the buffer of the serial port Byte The data of
delay(10);
i++ ;
}
if(Stop[i]=inByte[i])
{
if(Stop[i-1]==inByte[i-1]&&Stop[i-2]==inByte[i-2]&&Stop[i-3]==inByte[i-3])
{
flag=0;
Serial.println(" received !");
}// When I received stop Stop at command and reply to receive
}
if(flag==1)
{
Serial.println("Hello World!");// Send data to serial port
delay(100); // Delay
}
}
This code program realizes the following three functions
1) Continuous output to serial port “Hello world!”
2) When receiving “stop” when , Stop output 3) The light flashes .
Boil !
Remember to save , And how to upload Serial
My serial port is COM4
Before burning files, you need to press RESET Button to clear .
Because the code can also realize the small light flashing function , After burning in, the small light began to flash
This is Hu. We open the serial port and click the serial port monitor 

Ah, there is a problem ??
For a long time , It turns out that I just met somewhere ,usb The interface is loose , Lacrimal .
Output a pile …… The statement ??
Check the baud rate setting
The baud rate in the lower right corner of the serial port monitor is set to 115200 Baud rate ,
It's finally over , Why do I have a bunch of strange problems
summary
Arduino IDE Software STM32 Serial communication is also very simple , Interface design functions are not so cumbersome . The above is based on Ardunio complete STM32 Development board serial communication program .
If we want to say based on standard library functions and based on HAL Of library functions stm32 Differences in programming methods , First of all, the standard peripheral library makes it easier for us to write code .
and HAL The library shows that it can be implemented from a STM32 The product was ported to a different STM32 Series of products , And it's very convenient !
边栏推荐
- 深度优先遍历(Depth First Search, 简称 DFS)
- 吴恩达机器学习第14-15章
- 感知智能手機上用戶的關注狀態
- Mapping index attribute & operation of creating index
- Read pictures and convert them to show different color spaces
- UDP message structure
- 《PyTorch深度学习实践》-B站 刘二大人-day3
- libevent 报 undefined reference to `getrandom‘
- 常见的用户密码加密方式以及破解方法
- 渣渣学习之路(1)输出某年某月的日历页
猜你喜欢

NAND nor flash flash flash product overview

DSL implements metrics aggregation

Design and implementation of a gesture control system for tablet computer based on gaze

Spot detection record

感知智能手機上用戶的關注狀態

Robot stitching gesture recognition and classification

Manjaro 系统日常使用入门导引

Depth first search (DFS for short)

Restapi implements aggregation (dark horse tutorial)

《PyTorch深度学习实践》-B站 刘二大人-day6
随机推荐
深度优先遍历(Depth First Search, 简称 DFS)
Application of views and index files
redis
锁
基于I2C的温度采集实验及实验心得
DSL realizes automatic completion query
Binary search and its extension
redis
F5 GTM(一):DNS参数
Performance comparison between merge into and update in Oracle
X11 forwarding
《PyTorch深度学习实践》-B站 刘二大人-day3
Some problems encountered in work
渣渣学习之路(1)输出某年某月的日历页
libevent 报 undefined reference to `getrandom‘
吴恩达机器学习第14-15章
C 语言结构体数组指针以及函数
双代号时标网络图
STM32串口通信相关学习
Experiment 1 simple program design