There are a few different I/O options on the Sino:bit. Let's look at each in turn.
Alligator Clip Pads
Around the edge of the board are 8 pads for attaching alligator clips. In addition to 3v (VCC) and ground (GND) are 6 I/O connections labelled P0-P5. This is twice as many clip pads as the Micro:Bit. Like the Calliope, they are well removed from any other connections which reduces the risk of shorting with other signals. The library provides constants for referencing these pads.
The example below will pulse each of the pads in turn, repeatedly.
#include <sinobit.h> void setup() { pinMode(SINOBIT_PAD_P0, OUTPUT); pinMode(SINOBIT_PAD_P1, OUTPUT); pinMode(SINOBIT_PAD_P2, OUTPUT); pinMode(SINOBIT_PAD_P3, OUTPUT); pinMode(SINOBIT_PAD_P4, OUTPUT); pinMode(SINOBIT_PAD_P5, OUTPUT); } void pulse(int io_pin) { digitalWrite(io_pin, HIGH); delay(100); digitalWrite(io_pin, LOW); delay(100); } void loop() { pulse(SINOBIT_PAD_P0); pulse(SINOBIT_PAD_P1); pulse(SINOBIT_PAD_P2); pulse(SINOBIT_PAD_P3); pulse(SINOBIT_PAD_P4); pulse(SINOBIT_PAD_P5); }
UART
At the top left of the board is a four pin connector with GND, 5v, Rx, and Tx. Rx is also Pad P1 and P1 on the I/O connector (see below). Similarly Tx is Pad P2 and P2 on the expansion connector. This provides great flexibility in how you can connect to the UART: alligator clip wires, a 4-pin cable, or an expansion board.
I2C
Similarly to the UART, I2C signals are available on a four-pin connector at the top right of the board. Also like the UART signals, SDA and SCL are available on the expansion connector: SCL on P19, and SDA on P20. Unlike the UART signals, they are not available on any clip pads.
Expansion Connector
This is your standard 2x13 0.1" spacing connector. You can put a male header here facing up (so wires connect on the LED side of the board) for easy connection to a breadboard for prototyping, or a female header on the back for mounting an expansion board so that it doesn't block the LEDs. You could use a male header there as well, but I would use female to avoid the possibility of shorting against metallic stuff that might be on your desk or workbench. Then again that could get you a Sparky the Magic Blue Smoke Monster pin.
All the available I/O signals are on this connector: digital & analog connections, I2C, UART, and SPI. Additionally there are ground, 3.3v, and 5v lines.
As with the clip pads, the library defines constants for referring to these signals.
You have these connections available as you do on the Micro:bit. A big difference (described later) is that the LED matrix doesn't impact your use of I/O. Also, there are more available via clip pads.
- Pin #0 - clip pad - analog in
- Pin #1 - clip pad - analog in, also used for Rx
- Pin #2 - clip pad - analog in, also used for Tx
- Pin #3 - clip pad, analog in
- Pin #4 - clip pad, analog in
- Pin #5 - also used for Button A
- Pin #6
- Pin #7
- Pin #8
- Pin #9
- Pin #10 - clip pad, analog in
- Pin #11 - also used for button B
- Pin #12
- Pin #13 - also available as SPI clock
- Pin #14 - also available as SPI MISO
- Pin #15 - also available as SPI MOSI
- Pin #16
- Pin #19 - also available as I2C clock
- Pin #20 - also available as I2C data
There's still a bit of confusion over some of the details on this connector. Keep in mind that this v1 of the board and these details should be ironed out in coming versions.
Text editor powered by tinymce.