本文整理汇总了C++中ADXL362类的典型用法代码示例。如果您正苦于以下问题:C++ ADXL362类的具体用法?C++ ADXL362怎么用?C++ ADXL362使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ADXL362类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: begin
void SparkButton::begin(){
ring.begin();
ring.show();
accelerometer.begin(); // Setup SPI protocol, issue device soft reset
accelerometer.beginMeasure(); // Switch ADXL362 to measure mode
accelerometer.checkAllControlRegs(); // Burst Read all Control Registers, to check for proper setup
pinMode(D1, INPUT_PULLUP);
pinMode(D2, INPUT_PULLUP);
pinMode(D3, INPUT_PULLUP);
pinMode(D4, INPUT_PULLUP);
}
示例2: begin
void InternetButton::begin(int i){
if(i == 1 || i == 0){
pin = 17;
b1 = 1;
b2 = 2;
b3 = 3;
b4 = 4;
}
ring.begin();
ring.setPin(pin);
ring.show();
accelerometer.begin(); // Setup SPI protocol, issue device soft reset
accelerometer.beginMeasure(); // Switch ADXL362 to measure mode
accelerometer.checkAllControlRegs(); // Burst Read all Control Registers, to check for proper setup
pinMode(b1, INPUT_PULLUP);
pinMode(b2, INPUT_PULLUP);
pinMode(b3, INPUT_PULLUP);
pinMode(b4, INPUT_PULLUP);
}
示例3:
int SparkButton::readZ16(){
return accelerometer.readZ16();
}
示例4: lowestLed
//Thanks christophevg!
uint8_t InternetButton::lowestLed(){
float rads = atan2(accelerometer.readY16(),accelerometer.readX16());
uint8_t ledPos = (uint8_t)(12 - (rads/(M_PI/6) - 3)) % 12;
return ledPos;
}
示例5:
int InternetButton::readZ16(){
return accelerometer.readZ16();
}