In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Today, I would like to share with you how Python plug-in programming to light up the heart-shaped 8x8 lattice related knowledge, detailed content, clear logic, I believe that most people still know too much about this knowledge, so share this article for your reference, I hope you have something to gain after reading this article, let's take a look at it.
What is the TPYBoard development board
TPYBoard is a MicroPython development board based on MicroPython licensed by MIT. It is based on STM32F405 single-chip microcomputer and transmits data through USB interface. The development board has four LED lights and an acceleration sensor, which can work normally between 3V-10V. The TPYBoard development board allows users to easily control various peripherals of the microcontroller, such as LED, read pin voltage, play songs, connect with other devices, and so on, through Python code. TPYBoard development board supports direct operation of Python3.0 and above, gravity accelerometer, hundreds of peripheral accessories and SWD firmware. Zero foundation can also flexibly master single-chip microcomputer technology!
Second, using TPYBoard to complete the heart-shaped lattice.
1. Specific requirements
The red 8x8LED dot matrix screen is connected by TPYBoardv10x development board to realize the display of heart-shaped pattern.
2. Required devices
TYBoard development board
One USB cable
A red 8x8LED dot matrix screen
Some DuPont lines
3. Introduction of 8x8 dot matrix screen
There are two rows of pins behind the lattice, one begins with 1, that is, 1-8 pins, and the other begins with 9 (the opposite of 8 pins), that is, 9-16 pins. The number in the circle in the above picture is the corresponding sequence number of the pin. The corresponding pin of ROW 1 is 9. When the pins of a ROW are high and the pins of a COL are low, the LED at their intersection will be lit. To facilitate the manipulation of rows and columns, we can connect the eight pins of ROW to the eight pins of our X1MurX8 Col of TPYBoard v102 to the Y1-Y8 of our TPYBoard v102. In this way, we can control the light and non-light of each LED by controlling the high and low levels of the X and Y pins, so we can design any characters and graphics we want to display. Let's try it.
Third, the main process of production
4. Production process
Drawing code:
Import pybfrom pyb import * image = ['11111111,' 11011101, '1000000,' 10000000, '100000001,' 11000001, '11110111'] xroomp = [Pin (' X1baby PPMIN Pin.PULLINOLINE none), Pin ('X2examples and Pin.OUTRAPPPPJINE Pin.PULLINONE), Pin (' X3examples and Pin.OTTROPPPRINE Pin.PULLINONE), Pin ('X4examples) Pin, etc.), Pin ('Y2mom. Pin.PULL_NONE), Pin ('Y4baby recorder Pin.PULLFINONE), Pin (' Y5century recorder Pin.OUTZPPPPPRERENE), Pin ('Y6examples Min Pin.OUTZOTZPPPMINE Pin.PULLINONENE), Pin (' Y7century mother Pin.OUTROPPPPPPRINE Pin.PULLINONE), Pin ('Y8winter and Pin.OUTZPPPREN)] def displayLED (): flag = 1 for x in range (1,9): for b in range (1) 9): if b! = flag: temp = xp [int (b-1)] temp.low () li_l = image [int (x-1)] for k in range (1 9): temp = y _ p [int (k-1)] if li_ l [int (k-1)] = = '1int: temp.high () else: temp.low () temp = x _ p [flag-1)] temp.high () flag = flag + 1 delay (2) returnwhile True: displayLED () above is "how Python programming achieves lighting All the contents of the article "Heart-shaped 8x8 Lattice" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
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.