board_info: Mainly used for user-friendly development board pin configuration, built-in user-friendly naming and interface, which allows users to reduce the dependence on the electrical connection schematic.
board_info is a global variable defined with
Board_Info class, written by
MicroPython and integrated to firmware, source code see fpioa_manager.py
Board_info has many pin indexes and a list
The list is mainly used internally by the class, and the user does not operate it.
The pin index is mainly to convert numbers into human-friendly strings, which is convenient for users to program.
Enter the following, please be careful not to ignore the
. number, then press the
tab key to complete, you can see the board-related pin functions.
For example, enter the following code, it will return the number
8, which represents the 8th pin of the development board, and its electrical connection is the enable pin of the wifi module.
When the user does not know the pin electrical connection, you can use this method to find
This method does not pass in parameters or pass in a parameter
pin_num: pin number, range [6,47]
Board-level electrical connection information for all pins will be printed when no parameters are passed in
When the parameters are passed in, only the board-level electrical connection information for the specified pin is printed.
- Parameter error returns
- Unknown error return
- Find successful return information
from board import board_info Wifi_en_pin = board_info.WIFI_EN Print(wifi_en_pin)# output is 8 Board_info.pin_map()# print all Board_info.pin_map(8)# prints only pin 8 information