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.
You can see blocks the following new block after adding the 3-Axis accelerometer visualization extension:
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
2)Code a program:
2. Stage programming
1) Add the 3-Axis accelerometer visualization extension on the stage mode
2) Code a program:
3. Connect a device
Connect the Arduino main control panel and the 3-axis accelerometer to a computer and then click Connect
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.
Now you can see the changes in rotation of the cube in the visualization window on the stage mode.