差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン 次のリビジョン両方とも次のリビジョン | ||
arduino:grovebeginnerkit [2023/05/30 11:47] – [9. Air Pressure Sensor] baba | arduino:grovebeginnerkit [2024/05/21 10:52] – [2. Buzzer] baba | ||
---|---|---|---|
行 366: | 行 366: | ||
==== 8. Temperature & Humidity Sensor ==== | ==== 8. Temperature & Humidity Sensor ==== | ||
+ | Grove Temperature And Humidity Sensor | ||
< | < | ||
// | // | ||
行 447: | 行 448: | ||
</ | </ | ||
==== 10. 3-Axis Accelerator ==== | ==== 10. 3-Axis Accelerator ==== | ||
+ | grove-3-axis-digital-accelerometer-2g-to-16g を追加 | ||
+ | < | ||
+ | //Gravity Acceleration | ||
+ | #include " | ||
+ | #ifdef SOFTWAREWIRE | ||
+ | #include < | ||
+ | SoftwareWire myWire(3, 2); | ||
+ | LIS3DHTR< | ||
+ | #define WIRE myWire | ||
+ | #else | ||
+ | #include < | ||
+ | LIS3DHTR< | ||
+ | #define WIRE Wire | ||
+ | #endif | ||
+ | void setup() { | ||
+ | Serial.begin(9600); | ||
+ | while (!Serial) {}; | ||
+ | LIS.begin(WIRE, | ||
+ | delay(100); | ||
+ | LIS.setOutputDataRate(LIS3DHTR_DATARATE_50HZ); | ||
+ | } | ||
+ | void loop() { | ||
+ | if (!LIS) { | ||
+ | Serial.println(" | ||
+ | while (1); | ||
+ | return; | ||
+ | } | ||
+ | //3 axis | ||
+ | Serial.print(" | ||
+ | Serial.print(" | ||
+ | Serial.print(" | ||
+ | |||
+ | delay(500); | ||
+ | } | ||
+ | </ | ||