Tips-BPI-BIT
BPI:BIT
micro:bit の WROOM32版
http://wiki.banana-pi.org/BPI-Bit
MPU9250 9-axis sensor
MPU9250 uses I2C 0x69 address
# Check I2C communication..
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(115200);
while (!Serial);
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknown error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for next scan
}
https://qiita.com/naninunenoy/items/bf96f5ca34aacf347a9e
https://x-io.co.uk/open-source-imu-and-ahrs-algorithms/
KiCAD microbit-edie-conector
https://github.com/anthonykirby/kicad_microbit_connector
http://wiki.banana-pi.org/BPI-Bit
GPIO sensers
| GPIO control of BPI:bit | GPIO | ADC | |
|---|---|---|---|
| Light Sensor(L) | GPIO 36 | ADC1_CH0 | Analog Input_A0 |
| Light Sensor(R) | GPIO 39 | ADC1_CH3 | Analog Input_A3 |
| Botton A | GPIO 35 | Digital Input | |
| Botton B | GPIO 27 | Digital Input | |
| Temperature Sensor | GPIO 34 | ADC1_CH6 | Analog Input_Analog A6 |
| Buzzer | GPIO 25 | PWM(Digital Output) / Analog Output | |
| RGB_LED | GPIO 4 | Digital Output | |
| MPU9250_SCL | GPIO 22 | Digital Output | |
| MPU9250_SDA | GPIO 21 | Digital Output | |
| MPU9250_INT | GPIO 16 | Digital Input | |
| R_LED(SPI_SCK) | GPIO 18 | Digital Output |
HardWare PIN define of BPI:bit
| Pin Name | Analog Function1 | Analog Function2 | Function1 | Function2 | Power |
|---|---|---|---|---|---|
| P3 | ADC2_CH4 | GPIO13 | |||
| P0 | ADC2_CH8 | DAC_1 | GPIO25 | ||
| P4 | ADC2_CH3 | GPIO16 | |||
| P5 | ADC1_CH7 | GPIO35 | ボタンA | ||
| P6 | ADC2_CH5 | GPIO12 | |||
| P7 | ADC2_CH6 | GPIO14 | |||
| P1 | ADC1_CH4 | GPIO32 | |||
| P8 | GPIO16 | ||||
| P9 | GPIO17 | ||||
| P10 | ADC2_CH9 | DAC_2 | GPIO26 | ||
| P11 | ADC2_CH7 | GPIO27 | ボタンB | ||
| P12 | ADC2_CH2 | GPIO02 | |||
| P2 | ADC1_CH5 | GPIO33 | |||
| P13 | GPIO18 | SPI_SS | |||
| P14 | GPIO19 | SPI_SCK | |||
| P15 | GPIO23 | SPI_MISO | |||
| P16 | GPIO05 | SPI_MOSI | |||
| 3V3 | POWER:3V3 | ||||
| 3V3 | POWER:3V3 | ||||
| 3V3 | POWER:3V3 | ||||
| P19 | GPIO22 | I2C_SCL | |||
| P20 | GPIO21 | I2C_SDA | |||
| GND | GROUND | ||||
| GND | GROUND | ||||
| GND | GROUND |