VN100 hardware interface library.
Usage
- Declare an instance of VN100 with constructor VN100() taking SPIClass as argument. E.g. use
VN100 vn100(SPI_2);
for MBLC
- Call VN100::init() with the chip select pin (
PB12
on MBLC)
- Call VN100::get() with output arguments to get the filtered angles and angular rates.
Example (on MBLC 0.5)
#include <SPI.h>
#include <VN100.h>
void setup() {
Serial1.begin(115200);
vn100.init(PB12);
}
void loop() {
float ypr[3], rates[3]];
vn100.get(ypr[0], ypr[1], ypr[2], rates[0], rates[1], rates[2]);
Serial1 << tic << "\t" << ypr[0] << "\t" << ypr[1] << "\t" << ypr[2] << "\t";
Serial1 << rates[0] << "\t" << rates[1] << "\t" << rates[2] << "\n";
}