robocat图形化编程论坛-萝卜咖少年创客空间scratch,mixly,arduino

 找回密码
 立即注册
搜索
查看: 2530|回复: 0

microbit青少年python编程.C来看看MicroBit的IO资源

[复制链接]

130

主题

149

帖子

1700

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1700
发表于 2017-11-29 20:58:51 | 显示全部楼层 |阅读模式
未命名-1.png
Micro:bit有25个金手指型的可外扩IO口连接端口在板子上,我们成为‘pin’也可以称作管脚,端口,IO口等。这些金手指端口在上图中的右侧用灰色表示。其中有5个上面有洞的大的金手指(洞和金手指是相连的)。这些大的金手指被标记为0,1,2,3v,GND。除此之外当你吧Mirobit插入到金手指连接器时,还有20个小的金手指可供所使用。
大的金手指Pin你很方便的使用鳄鱼夹连接线,或者4mm香蕉头连接线连接到这5个大的Pin。

The first three, labelled 0, 1 and 2 are flexible and can be used for many different things - which means they are often called ‘general purpose input and output’ (shortened to GPIO). These three pins also have the ability to read analogue voltages using something called an analogue-to-digital converter (ADC). They all have the same function:
0: GPIO (general purpose digital input and output) with analogue to digital convertor (ADC).

1: GPIO with ADC

2: GPIO with ADC

The other two large pins (3V and GND) are very different!
hint

Watch out! The pins labelled 3V and GND relate to the power supply of the board, and they should NEVER be connected together.
power input: If the BBC micro:bit is powered by USB or a battery, then you can use the 3V pin as a power output to power peripherals with.
  • 3V: 3 volt power output or power input. (1) power output: If the BBC micro:bit is powered by USB or a battery, then you can use the 3V pin as a power output to power peripherals with; (2) power input: If the BBC micro:bit is not being powered by USB or battery, you can use the 3V pin as a power input to power the BBC micro:bit
  • GND: attaches to ground in order to complete a circuit (required when using the 3V pin)
If you hold the ‘GND’ pin with one hand, you can program the BBC microbit to detect yourself touching the 0,1 or 2 pins with your other hand, giving you three more buttons to experiment with (you just used your body to complete an electrical circuit).
Small pins

There are 20 small pins numbered sequentially from 3-22 (these pins are not labeled on the BBC micro:bit, however, they are labelled in the picture above).
Unlike the three large pins that are dedicated to being used for external connections, some of the small pins are shared with other components on the BBC micro:bit board. For example, pin 3 is shared with some of the LEDs on the screen of the BBC micro:bit, so if you are using the screen to scroll messages, you can’t use this pin as well.
  • pin 3: GPIO shared with LED Col 1 of the LED screen; can be used for ADC and digital I/O when the LED screen is turned off.
  • pin 4: GPIO shared with LED Col 2 of the LED screen; can be used for ADC and digital I/O when the LED screen is turned off.
  • pin 5: GPIO shared with Button A. This lets you trigger or detect a button "A" click externally. This pin has a pull-up resistor, which means that by default it is at voltage of 3V. To replace button A on the BBC micro:bit with an external button, connect one end of the external button to pin 5 and the other end to GND. When the button is pressed, the voltage on pin 5 is pulled down to 0, which generates a button click event.
  • pin 6: GPIO shared with LED Col 9 of the LED screen; can be used for digital I/O when the LED screen is turned off.
  • pin 7: GPIO shared with LED Col 8 of the LED screen; can be used for digital I/O when the LED screen is turned off.
  • pin 8: Dedicated GPIO, for sending and sensing digital signals.
  • pin 9: GPIO shared with LED Col 7 of the LED screen; can be used for digital I/O when the LED screen is turned off.
  • pin 10: GPIO shared with LED Col 3 of the LED screen; can be used for ADC and digital I/O when the LED screen is turned off.
  • pin 11: GPIO shared with Button B. This lets you trigger or detect a button “B” click externally.
  • pin 12: Dedicated GPIO, for sending and sensing digital signals.
  • pin 13: GPIO that is conventionally used for the serial clock (SCK) signal of the 3-wire Serial Peripheral Interface (SPI) bus.
  • pin 14: GPIO that is conventionally used for the Master In Slave Out (MISO) signal of the SPI bus.
  • pin 15: GPIO that is conventionally used for the Master Out Slave In (MOSI) signal of the SPI bus.
  • pin 16: Dedicated GPIO (conventionally also used for SPI ‘Chip Select’ function).
  • pins 17 and 18: these pins are wired to the 3V supply, like the large ‘3V’ pad.
  • pins 19 and 20: implement the clock signal (SCL) and data line (SDA) of the I2C bus communication protocol. With I2C, several devices can be connected on the same bus and send/read messages to and from the CPU. Internally, the accelerometer and the compass are connected to i2c.
  • pins 21 and 22: these pins are wired to the GND pin and serve no other function
Connecting to the small pins

It is recommended that an edge connector be acquired to connect to the small pins, for example the Edge Connector from Kitronik.


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|robocat图形化编程论坛-萝卜咖少年创客空间 ( 苏ICP备17052792

GMT+8, 2019-12-12 05:38 , Processed in 0.022799 second(s), 32 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表