24 lines
497 B
JavaScript
24 lines
497 B
JavaScript
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++)
|
|
{
|
|
setTimeout(() => {
|
|
console.log("Sending data");
|
|
fetch(address, {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify(data)
|
|
});
|
|
}, i * 1000);
|
|
} |