Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use ADC

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to use ADC". In daily operation, I believe many people have doubts about how to use ADC. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to use ADC". Next, please follow the editor to study!

1. Preface

Abbreviation for ADC,Analog-to-DigitalConverter, finger / digital converter or analog-to-digital converter [1]. It refers to the device that converts continuously changing analog signals into discrete digital signals. Real-world analog signals, such as temperature, pressure, sound or images, need to be converted into digital forms that are easier to store, process, and transmit.

The corresponding DAC,Digital-to-AnalogConverter is the reverse process of ADC analog-to-digital conversion.

ADC is widely used in the development of single-chip microcomputer. This article is the first in a series of ADC articles to get to know the application of ADC in TPYBoard.

2.TPYBoard support for ADC

TPYBoard comes with 12 ADC pins, which are:

X11,X12,Y11,Y12,X1,X2,X3,X4,X5,X6,X7,X8 .

The use of STM32 chip ADC with a precision of 16 bits can fully support the general requirements of ADC use

The output data of ADC is 0-4095, which is a digital analog signal. All kinds of data can be restored by calculation.

3. Required equipment

TPYBoard10X together

A data line

Serial debugging tool

4. Effect display

Figure 1: using the Y11ADC foot to get the output data is about 800. the picture shows using Putty to print the serial port data.

Figure 2: press the Y11 pin with your finger and release (the effect is shown in figure 3)

Figure 3:

5. Code

# main.py-- put your code hereafter import pybadc = pyb.ADC (pyb.Pin ('Y11')) while True: pyb.delay (1000) val = adc.read () print (val) this ends the study of "how to use ADC", hoping to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report