This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from "react"; | |
import { StatusBar, Dimensions, Text, View } from "react-native"; | |
import { DeviceMotion } from "expo-sensors"; | |
import Svg, { Circle, Line } from "react-native-svg"; | |
const { height, width } = Dimensions.get("window"); | |
const centerX = width / 2, | |
centerY = height / 2; | |
export default function App() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { height, width } = Dimensions.get("window"); | |
const centerX = width / 2, | |
centerY = height / 2; | |
// .... | |
let { beta, gamma } = data; | |
gamma = round(gamma); | |
beta = round(beta); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { height, width } = Dimensions.get("window"); | |
const centerX = width / 2, centerY = height / 2; | |
//.... | |
const shadowElement = ( | |
<> | |
<Line | |
x1={centerX} | |
y1={centerY} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [data, setData] = useState({}); | |
//Call Once when Screen loads | |
useEffect(() => { | |
//Subscribe Function | |
_subscribe(); | |
//Call Once when Screen unloads | |
return () => { | |
_unsubscribe(); //Unsubscribe Function | |
}; | |
}, []); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"acceleration": { | |
"z": -0.0005327463150024414, | |
"y": 0.0034074783325195312, | |
"x": 0.0005932972417213023 | |
}, | |
"accelerationIncludingGravity": { | |
"z": -0.8134145140647888, | |
"y": -9.769495010375977, | |
"x": 0.0011865944834426045 |