2015-07-15 15:04:15 +02:00
|
|
|
# Doodle3D-API
|
|
|
|
Doodle3D API for communication with the Doodle3D WiFi-Box
|
2015-07-15 15:10:05 +02:00
|
|
|
|
|
|
|
```javascript
|
2016-04-21 15:52:23 +02:00
|
|
|
import { Doodle3DManager } from 'Doodle3D/Doodle3D-API';
|
2015-07-15 15:10:05 +02:00
|
|
|
|
2015-09-19 15:10:41 +02:00
|
|
|
const doodle3DManager = new Doodle3DManager();
|
2015-07-15 15:10:05 +02:00
|
|
|
|
2015-09-19 15:10:41 +02:00
|
|
|
doodle3DManager.addEventListener('boxappeared', ({box}) => {
|
2016-04-21 15:52:23 +02:00
|
|
|
box.addEventListener('connect', (event) => {
|
|
|
|
});
|
2015-07-24 13:15:00 +02:00
|
|
|
|
2016-04-21 15:52:23 +02:00
|
|
|
box.addEventListener('disconnect', (event) => {
|
|
|
|
});
|
2015-07-24 13:15:00 +02:00
|
|
|
|
2016-04-21 15:52:23 +02:00
|
|
|
box.addEventListener('update', (event) => {
|
|
|
|
const status = event.state;
|
|
|
|
});
|
2015-07-24 13:15:00 +02:00
|
|
|
|
2016-04-21 15:52:23 +02:00
|
|
|
box.setAutoUpdate(true, 1000);
|
2015-07-24 13:15:00 +02:00
|
|
|
});
|
|
|
|
|
2016-04-21 15:52:23 +02:00
|
|
|
doodle3DManager.setAutoUpdate(true, 1000);
|
2015-07-15 15:10:05 +02:00
|
|
|
|
|
|
|
```
|