Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 5:f2944e456618
- Parent:
- 4:4c01d79dd741
--- a/main.cpp Thu Jul 24 01:10:38 2014 +0000
+++ b/main.cpp Thu Jul 24 02:15:11 2014 +0000
@@ -10,14 +10,22 @@
LPS331_I2C lps331(p9, p10, LPS331_I2C_SA0_HIGH); // 気圧センサ
int main() {
+ char id;
+ printf("start BBsat\r\n");
JP.mode(PullUp);
+ id = lps331.whoami();
+ printf("id = %x\r\n", id);
+
lps331.setResolution(LPS331_I2C_PRESSURE_AVG_512, LPS331_I2C_TEMP_AVG_128);
lps331.setDataRate(LPS331_I2C_DATARATE_7HZ); // 7Hz(1秒間に7回更新)
lps331.setActive(true); // 動作開始
FILE *fp = fopen("/local/data.txt", "a"); // 「追記」でファイルを開く
+ if(fp==NULL) {
+ printf("fopen error.\r\n");
+ }
fprintf(fp,"BBsat start. **********\r\n"); // fprintf()は、ファイルに文字を出力
fclose(fp);