Fix sensors
Signed-off-by: Vasiliy Doylov <nekodevelopper@gmail.com>
This commit is contained in:
parent
6cd59c2416
commit
2e158e3c97
1 changed files with 4 additions and 2 deletions
|
@ -23,7 +23,8 @@ double rad2deg(double angle) {
|
||||||
[GtkTemplate(ui = "/io/gitlab/nekocwd/the-cat-tools/window.ui")]
|
[GtkTemplate(ui = "/io/gitlab/nekocwd/the-cat-tools/window.ui")]
|
||||||
public class TheCatTools.Window : Adw.ApplicationWindow {
|
public class TheCatTools.Window : Adw.ApplicationWindow {
|
||||||
[GtkChild]
|
[GtkChild]
|
||||||
private unowned GUI.BoubleBar bar;
|
private unowned GUI.BoubleBar hbar;
|
||||||
|
private unowned GUI.BoubleBar vbar;
|
||||||
private SSC.SensorAccelerometer accel;
|
private SSC.SensorAccelerometer accel;
|
||||||
|
|
||||||
async void start_sensors() {
|
async void start_sensors() {
|
||||||
|
@ -39,7 +40,8 @@ public class TheCatTools.Window : Adw.ApplicationWindow {
|
||||||
|
|
||||||
message("%f\t%f\t%f", x, y, z);
|
message("%f\t%f\t%f", x, y, z);
|
||||||
message("%f\t%f", x_angle, y_angle);
|
message("%f\t%f", x_angle, y_angle);
|
||||||
bar.value = (float) y_angle;
|
hbar.value = (float) x_angle;
|
||||||
|
vbar.value = (float) x_angle;
|
||||||
});
|
});
|
||||||
} catch (Error err) {
|
} catch (Error err) {
|
||||||
message("Failed to open Sensor %s", err.message);
|
message("Failed to open Sensor %s", err.message);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue