How would one use the wiringPi SPI library (http://wiringpi.com/reference/spi-library/) to get the x and y readings from this SCA100T inclinometer?

I understand that the function wiringPiSPIDataRW() in the wiringPi SPI library performs a simulantous read and write, but if the data from the inclinometer is only 11 bits how would I get those bits from what the function returns?

This is it's datasheet: https://www.mouser.com/pdfdocs/sca100t_inclinometer_datasheet_8261800b2_0.PDF

  • You need to send in byte (8 bit) multiples. Send enough bytes to cover the command and response bits and just ignore any irrelevant received bits. If you can't get it to work show your code and explain what is going wrong. – joan May 3 '18 at 16:49
  • Thanks for the response. I finally am receiving data, now it's just a matter of selecting the bits that I'm interested in. – user124757 May 3 '18 at 21:31
  • If you get a particular problem edit it into your question if you need help. – joan May 4 '18 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.