本文整理汇总了Java中com.microsoft.band.sensors.BandAccelerometerEvent类的典型用法代码示例。如果您正苦于以下问题:Java BandAccelerometerEvent类的具体用法?Java BandAccelerometerEvent怎么用?Java BandAccelerometerEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BandAccelerometerEvent类属于com.microsoft.band.sensors包,在下文中一共展示了BandAccelerometerEvent类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onBandAccelerometerChanged
import com.microsoft.band.sensors.BandAccelerometerEvent; //导入依赖的package包/类
@Override
public void onBandAccelerometerChanged(final BandAccelerometerEvent event) {
if (event != null) {
// appendToUI(String.format(" 加速度:\n X = %.6f \n Y = %.6f\n Z = %.6f\n", event.getAccelerationX(),
// event.getAccelerationY(), event.getAccelerationZ()));
// SendSensorData(String.format("a %.6f %.6f %.6f", event.getAccelerationX(),
// event.getAccelerationY(), event.getAccelerationZ()));
if (System.currentTimeMillis() - lastRefreshTime > REFRESH_TIME) {
lastRefreshTime = System.currentTimeMillis();
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
xEntryList.add(new BarEntry(xEntryList.size(), event.getAccelerationX()));
setData(xChart, xEntryList.subList(xEntryList.size() - 60, xEntryList.size()));
yEntryList.add(new BarEntry(yEntryList.size(), event.getAccelerationY()));
setData(yChart, yEntryList.subList(yEntryList.size() - 60, yEntryList.size()));
zEntryList.add(new BarEntry(zEntryList.size(), event.getAccelerationZ()));
setData(zChart, zEntryList.subList(zEntryList.size() - 60, zEntryList.size()));
}
});
}
}
}
开发者ID:qizhenghao,项目名称:Microsoft_Band,代码行数:25,代码来源:AccelerateFragment.java
示例2: onBandAccelerometerChanged
import com.microsoft.band.sensors.BandAccelerometerEvent; //导入依赖的package包/类
@Override
public void onBandAccelerometerChanged(BandAccelerometerEvent bandAccelerometerEvent)
{
dataReceived();
accelerationX = bandAccelerometerEvent.getAccelerationX();
accelerationY = bandAccelerometerEvent.getAccelerationY();
accelerationZ = bandAccelerometerEvent.getAccelerationZ();
}
开发者ID:hcmlab,项目名称:ssj,代码行数:9,代码来源:BandListener.java
示例3: onBandAccelerometerChanged
import com.microsoft.band.sensors.BandAccelerometerEvent; //导入依赖的package包/类
@Override
public void onBandAccelerometerChanged(final BandAccelerometerEvent event) {
if (event != null) {
appendToUI(String.format(" 加速度:\n X = %.6f \n Y = %.6f\n Z = %.6f\n", event.getAccelerationX(),
event.getAccelerationY(), event.getAccelerationZ()));
SendSensorData(String.format("a %.6f %.6f %.6f", event.getAccelerationX(),
event.getAccelerationY(), event.getAccelerationZ()));
}
}
开发者ID:qizhenghao,项目名称:Microsoft_Band,代码行数:11,代码来源:WelcomeActivity.java
示例4: onBandAccelerometerChanged
import com.microsoft.band.sensors.BandAccelerometerEvent; //导入依赖的package包/类
@Override
public void onBandAccelerometerChanged(final BandAccelerometerEvent event) {
double[] samples = new double[3];
samples[0] = event.getAccelerationX();
samples[1] = event.getAccelerationY();
samples[2] = event.getAccelerationZ();
DataTypeDoubleArray dataTypeDoubleArray = new DataTypeDoubleArray(DateTime.getDateTime(), samples);
sendData(dataTypeDoubleArray);
callBack.onReceivedData(dataTypeDoubleArray);
}
开发者ID:MD2Korg,项目名称:mCerebrum-MicrosoftBand,代码行数:11,代码来源:Accelerometer.java
注:本文中的com.microsoft.band.sensors.BandAccelerometerEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论