In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to use the positioner to control the LED brightness in PYB Nano. The quality of the article is high, so Xiaobian shares it with you as a reference. I hope you have a certain understanding of relevant knowledge after reading this article.
The Demo below demonstrates using a positioner to control LED brightness.
Use an external positioner and connect the positioner to PYB Nano pin X9/PB1 with a Dupont cable.
Then type in the following program
>>> from pyb import ADC, Pin >>> adc = ADC(Pin('X9')) >>> while True: ... dat = adc.read() ... pyb.LED(1).intensity(dat>>4) ... print(dat) ... pyb.delay(200)
Changing the positioner will output the current ADC result on the screen and change the brightness of LED1.
Note:
X9 above can be changed to X0-X9 (ADC function supported).
LED(1) can be changed to 1-4, they all support brightness adjustment function.
About PYB Nano how to use the positioner to control LED brightness to share here, I hope the above content can have some help for everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.