Yebal
This commit is contained in:
@@ -1,24 +1,22 @@
|
||||
const address = 'http://145.92.8.135:3445/';
|
||||
|
||||
const data = {
|
||||
rotationX: 1,
|
||||
rotationY: .4,
|
||||
rotationZ: .1,
|
||||
accelerationX: 1,
|
||||
accelerationY: 2,
|
||||
accelerationZ: 4,
|
||||
deviceId: 1,
|
||||
type: 'data'
|
||||
};
|
||||
|
||||
for ( let i = 0; i < 10; i++)
|
||||
const address = 'http://192.168.137.45:3445';
|
||||
const amount = 10;
|
||||
for ( let i = 0; i < amount; i++)
|
||||
{
|
||||
setTimeout(() => {
|
||||
console.log("Sending data");
|
||||
fetch(address, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(data)
|
||||
body: JSON.stringify({
|
||||
rotationX: 0,
|
||||
rotationY: 0,
|
||||
rotationZ: 0,
|
||||
accelerationX: Math.PI / amount * i,
|
||||
accelerationY: 0,
|
||||
accelerationZ: 0,
|
||||
type: 'data',
|
||||
deviceId: 0
|
||||
})
|
||||
});
|
||||
}, i * 1000);
|
||||
}
|
Reference in New Issue
Block a user