-1

Hi im making a website and want to stream the gyroscope sensors that are in phones(android or iOS) to my website in real time. I have looked at this site https://community.wolfram.com/groups/-/m/t/1386358 however I am not sure on how to get this method to work as I've never used wolfram language. Does anyone have any ideas?

Ainz
  • 366
  • 2
  • 13
Wq0234
  • 19
  • Rather than ask the 'open ended' and broad question of 'how do I do this', you ought to try to put together a minimal example and ask a specific question related to where you are getting stuck/confused. Re: ios sensors - these may help: https://developer.mozilla.org/en-US/docs/Web/API/Detecting_device_orientation OR https://dzone.com/articles/how-use-gyroscope-your-iphone – Ben A. Hilleli Jan 14 '21 at 02:02

1 Answers1

1

I think you might be better off with a codesandbox while you try to figure things out. I used one while trying to figure out some ThreeJS stuff, tapping in to the device gyroscope with the Device Orientation API.

You can user webrtc to create a peer to peer connection if you want to read the data on your laptop.

Here is another post on the topic:

How to access accelerometer/gyroscope data from Javascript?

Here is some sample code from that post:

window.addEventListener("deviceorientation", handleOrientation, true);

The event handler function can look something like this:

function handleOrientation(event) {
  var absolute = event.absolute;
  var alpha    = event.alpha;
  var beta     = event.beta;
  var gamma    = event.gamma;
  // Do stuff with the new orientation data
}
ekrenzin
  • 387
  • 2
  • 12