A library to control io of HaLakeKit.
- Open library manager.
Sketch -> Include library -> Manage Libraries
-
Search "HaLakeKit" on library manager.
-
Click "Install" button.
Plese call begin of HaLakeKit in setup of Arduino.
HaLakeKit halakekit;
void setup() {
halakekit.begin();
}
You can get or print accel info.
Serial.println(halakekit.accel_x());
Serial.println(halakekit.accel_y());
Serial.println(halakekit.accel_z());
Serial.println(halakekit.accel_comp());
halakekit.accel_print_xyz();
delay(100);
An Example project for accel is available.
You can get switch info about pushed or not.
if ( halakekit.switch_pushed() ) {
// do something
}
Adjust offset value like this.
halakekit.mag_x_offset = -50;
halakekit.mag_y_offset = -55;
// halakekit.mag_z_offset = -10;
You gan get or print magnetometer values.
halakekit.mag_update();
Serial.println("print mag values");
Serial.println("mag_x: " + String(halakekit.mag_x()));
Serial.println("max_y: " + String(halakekit.mag_y()));
Serial.println("mag_z: " + String(halakekit.mag_z()));
Serial.println("horizontal direction: " + String(halakekit.mag_horiz_direction()));
MIT