1684 views|4 replies

44

Posts

1

Resources
The OP
 

[ACM32F070 supporting capacitive touch development board target -- Arduino preparation for dual-machine UART communication linkage] [Copy link]

 This post was last edited by JohnMatthrew on 2022-11-5 23:30

It was a very pleasant experience, and it was easy to get started with this development board. Although I have used STM32, I usually do pure hardware development and use it less. (An employee of a new energy vehicle company, haha) As the supervisor of the main drive hardware project, I am very busy. I do everything in my spare time. I have been working hard and have done the verification. After the verification is done, I will share it with everyone. After a period of learning and experiencing the Hangxin ACM32F070 kit development board, the experience is almost over. At this time, I have to come up with some dry goods, which corresponds to my evaluation theme, so please link it with the Arduino serial communication.

Let me share with you the materials used:

1. A set of capacitive touch development board for Hangxin ACM32F070 (which is our great application evaluation tool)

2、Arduino Pro mini

3. A CH340G downloader (mainly for burning programs to Arduino and testing the serial port's sending and receiving)

4. A PC (for writing code and debugging)

First, I used my Pro mini to write the code and reserve some information needed for our serial port. In this issue, I will first plan our functional blueprint.

The simplest way to highlight our capacitive touch is to assign values to the up, down, left, and right buttons respectively, and press the corresponding button to send the corresponding character.

Up----- a

Next -------b

Left --------c

Right---------d

Assign the values separately. After receiving, let Arduino return 1 (received)

So, how do you write Arduino code? Start typing the code.

First start initialization:

void setup()

{

// Flash a light during initialization

digitalWrite(13,HIGH);

delay(100);

digitalWrite(13,LOW);

delay(100);

//Set the baud rate of the serial port to ensure that everyone can chat at the same frequency

Serial.begin(115200);

Serial.print("initialize OK");

delay(10);

}

This completes the initialization settings. The next step is the hard work. However, I think it is better to do simple things simply, and one round of string recognition is enough. Before this, add the global variable String temp to the beginning, which is the safest way to do the content received by the serial port.

Next to the loop content:

void loop(){

//First, let our serial port receive things normally, then arrange recognition, and wait a while before recognizing after receiving.

if(Serial.available()>0)

{

delay(20);

temp = Serial.readString();

//Next, the judgment starts. As long as one of abcd is sent, it will reply 1

//Adhering to the attitude of open source, I will release the key code hahaha, but I will post the specific source code on my Gitlab or Github, everyone is welcome to get it

if(temp=="a"){

digitalWrite(13,HIGH);

delay(50);

digitalWrite(13,LOW);

delay(50);

Serial.print("1");

}

Prepare the contents abcd in sequence, all of which are reply 1. If you want to change to something else, it doesn’t matter, just modify the code.

I'll show you the video overview. I'll burn the code into Arduino and verify it with the serial debugging assistant. Everything is OK. Once you send one of the characters abcd, reply 1

After that, I will finish the next phase and prepare the aviation core kit.

Make arrangements hahaha

视频1.mp4

490.86 KB, downloads: 3

帖子插入视频

This post is from Domestic Chip Exchange

Latest reply

come on!   Details Published on 2022-11-9 07:05
 
 

6841

Posts

11

Resources
2
 

The video can be uploaded directly, so that it can be watched online, which is convenient for viewing. The video does not show the communication with the development board. It is best to demonstrate it completely before posting it. Otherwise, the judges will think that it is purely for the purpose of completing the homework.

This post is from Domestic Chip Exchange

Comments

I am not very good at using the forum function. I would like to ask you for help in some areas. Thank you.  Details Published on 2022-11-8 20:26
 
 
 

44

Posts

1

Resources
3
 
lugl4313820 posted on 2022-11-6 09:00 The video can be uploaded directly, so that it can be watched online and conveniently. The video does not show the communication with the development board. It is best to demonstrate it completely before posting...

I am not very good at using the forum function. I would like to ask you for help in some areas. Thank you.

This post is from Domestic Chip Exchange

Comments

come on!  Details Published on 2022-11-9 07:05
 
 
 

6841

Posts

11

Resources
4
 
JohnMatthrew posted on 2022-11-8 20:26 I am not very good at using the forum function. I would like to ask you for advice on some issues. Thank you

come on!

This post is from Domestic Chip Exchange

Comments

This time it's all updated, and all the necessary videos are here in one go. Thank you very much for your suggestions!  Details Published on 2022-11-9 08:41
 
 
 

44

Posts

1

Resources
5
 

This time it's all updated, and all the necessary videos are here in one go. Thank you very much for your suggestions!

This post is from Domestic Chip Exchange
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list