3-axis Accelerometer Visualization extension can display the values of accelerometer sensors in the form of virtual cube.

Add 3-axis Accelerometer Visualization extension

Select “3-axis Accelerometer Visualization” in the Extension Library.
image.png
You can see blocks the following new block after adding the 3-Axis accelerometer visualization extension:
image.png

Example

Next, we will learn how to use 3-Axis accelerometer visualization extension blocks with an example

1. Device programming

1) Switch a device to Arduino Uno/Mega
3-axis Accelerometer Visualization Extension - 图3
2)Code a program:
3-Axis accelorometer-device.png

2. Stage programming

1) Add the 3-Axis accelerometer visualization extension on the stage mode
2) Code a program:
3-Axis accelorometer-stage.png

3. Connect a device

Connect the Arduino main control panel and the 3-axis accelerometer to a computer and then click Connect
image.png

4. Run a program

After connecting a device, return back to the stage mode and click Open 3-Axis Accelerometer Window and then click the “green flag” to run the program.
image.png
Now you can see the changes in rotation of the cube in the visualization window on the stage mode.