Commit 0a16234d authored by Jens-Christian Fischer's avatar Jens-Christian Fischer
Browse files

debug scaling

parent 9474d443
......@@ -3,7 +3,7 @@ defmodule Grains.Mixfile do
def project do
[app: :grains,
version: "0.0.23",
version: "0.0.24",
elixir: "~> 1.2",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
......
......@@ -24,6 +24,9 @@ defmodule Grains.OrientationChannel do
heading = params["heading"]
StatefulMap.put("pitch", pitch)
StatefulMap.put("roll", roll)
StatefulMap.put("yaw", yaw)
StatefulMap.put("heading", heading)
broadcast! socket, "orientation", %{
user: %{id: "anon"},
......
......@@ -63,10 +63,11 @@ let OrientationPanel = {
let scaled = values.map(function(i) {
return parseInt(i * 127);
});
console.log(scaled);
let payload = {pitch: scaled[0],
roll: scaled[1],
yaw: scaled[2],
heading: scaled[4]
heading: scaled[3]
};
this.orientationChannel.push("orientation", payload)
.receive("error", e => console.log(e));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment