トップ 差分 一覧 ソース 検索 ヘルプ RSS ログイン

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
}

KiCAD microbit-edie-conector

https://github.com/anthonykirby/kicad_microbit_connector

GPIO sensers

GPIO control of BPI:bit
Light Sensor(L) GPIO 36 Analog Input
Light Sensor(R) GPIO 39 Analog Input
Botton A GPIO 35 Digital Input
Botton B GPIO 27 Digital Input
Temperature Sensor GPIO 34 Analog Input
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