This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Question about connect arduino primo to BMI160 using SPI..

Hi l trying to hookup arduino primo and BMI160,but recently my develop is in a strange situation,that i sent 0x00 and others register but alway return 0xff, here shows the pin connection and my test code, any suggestion would be thankful..

image description

.#include "SPI.h"

void setup() {
  Serial.begin(9600);
  pinMode (SS, OUTPUT);
  digitalWrite(SS, LOW);
  delay(10);  
  digitalWrite(SS, HIGH);
  SPI.begin();

 
}

void loop() {
  byte returnValue=0;
  digitalWrite(SS, LOW);
  returnValue=SPI.transfer(0x7F);
  digitalWrite(SS,HIGH);
  Serial.println(returnValue);    
  digitalWrite(SS, LOW);
  returnValue=SPI.transfer(0x00);
  digitalWrite(SS,HIGH);
  Serial.println(returnValue);
  delay(1000);
   
}
Parents Reply Children
Related