An example program for Lazurite Graph
Dependencies: BM1383GLV KX022 mbed
main.cpp
00001 /* 00002 00003 Test program to use Rohm sensors with Lazurite Graph application 00004 http://www.lapis-semi.com/lazurite-jp/contents/LazuriteGraph/LazuriteGraph.html 00005 00006 */ 00007 00008 #include "mbed.h" 00009 #include "KX022.h" 00010 #include "BM1383GLV.h" 00011 00012 Serial pc(USBTX, USBRX); 00013 KX022 acc(I2C_SDA, I2C_SCL); 00014 BM1383GLV sensor(I2C_SDA, I2C_SCL); 00015 00016 int main() { 00017 pc.baud(115200); 00018 00019 while(1) { 00020 pc.printf("STX,"); 00021 pc.printf("%.2f,", acc.getAccX()); 00022 pc.printf("%.2f,", acc.getAccY()); 00023 pc.printf("%.2f,", acc.getAccZ()); 00024 pc.printf("%.2f,", sensor.getPressure()); 00025 pc.printf("%.2f", sensor.getTemperature()); 00026 pc.printf(",ETX\n"); 00027 wait(0.1); 00028 } 00029 }
Generated on Sun Jul 17 2022 00:32:19 by
1.7.2