2016-03-02 53 views
0

我已经按照网上指南设置约翰尼五和颗粒-IO,我觉得一切都工作了。如果我运行node process.env,则可以看到我的DEVICE_ID和DEVICE_TOKEN。我与节点运行示例代码我在this引导发现什么,我得到的是and this is not my device ID!粒子光子约翰尼五粒子-IO接口

我期待在命令提示符下输出的

console.log("accelerometer"); 
console.log(" x   : ", this.x); 
console.log(" y   : ", this.y); 
console.log(" z   : ", this.z); 
console.log(" pitch  : ", this.pitch); 
console.log(" roll   : ", this.roll); 
console.log(" acceleration : ", this.acceleration); 
console.log(" inclination : ", this.inclination); 
console.log(" orientation : ", this.orientation); 
console.log("--------------------------------------"); 

的结果,但我想我可能是错的?如果是这样,我会在哪里看到输出结果?这是我第一次使用jonny-5和node的经验,所以对不起,如果它有点困惑..

+0

如果你显示你的代码,我可以帮你吗? –

回答

0

我没有使用johnny-five setup设置粒子,但我可以指导你如何获取值从粒子仪表板上的传感器MPU-6050。

可以使用MPU-6000的这个代码是一样的,你使用的MPU-6050和闪存这样一个粒子生成和检查颗粒仪表板的输出。

https://github.com/ControlEverythingCommunity/MPU-6000/blob/master/Particle/MPU-6000.ino

欲知详情如何做到这一点,你也可以去通过将显示与粒子和数据网络信息中心传感器的描绘I2C接口的视频。

https://www.youtube.com/watch?v=-_DfUd9Ug9w.I希望解决您的问题。