Arduino Uno
IMU - http://www.jebobrow.com/
digiPot - https://www.arduino.cc/en/Tutorial/SPIDigitalPot
IMU data goes erratic just as soon as digiPot SPI.transfer(address) command is used.
void digitalPotWrite(int address, int value) {
digitalWrite(slaveSelectPin,LOW); // select the chip:
--> here // SPI.transfer(address); // send address and value via SPI:
// SPI.transfer(value);
digitalWrite(slaveSelectPin,HIGH); // de-select the chip:
}
If I leave the comments in on that line, the IMU gives good data. If I uncomment that line, the data from the IMU is incorrect. Do I need to use beginTransaction () or some such? Why doesn't this work?
SPI bus?
http://www.dorkbotpdx.org/blog/paul/better_spi_bus_design_in_3_steps