BMG160: Add string based cons for 3-axis Gyroscope

Signed-off-by: Adelin Dobre <adelin.dobre@rinftech.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Adelin Dobre
2018-07-17 14:42:58 +03:00
committed by Mihai Tudor Panu
parent 40f6bd9c6c
commit 9f545f10af
3 changed files with 168 additions and 2 deletions

View File

@ -173,10 +173,9 @@ BMA250E::BMA250E(std::string initStr) : mraaIo(initStr)
writeReg(reg, val);
}
if(tok.substr(0,9) == "setRange:") {
BMA250E_RANGE_T scale = (BMA250E_RANGE_T)std::stoi(tok.substr(22),nullptr,0);
BMA250E_RANGE_T scale = (BMA250E_RANGE_T)std::stoi(tok.substr(9),nullptr,0);
setRange(scale);
}
if(tok.substr(0,13) == "setBandwidth:") {
BMA250E_BW_T bw = (BMA250E_BW_T)std::stoi(tok.substr(13),nullptr,0);
setBandwidth(bw);