kidsbits blocks coding ADXL345 Acceleration module is fully compatible with kidsbits control board and Lego building blocks.
You can easily connect it to kidsbits control board for communication using an RJ11 cable without worrying about wrong connection and damage.
The kidsbits ADXL345 module is a small, low-power, three-axis accelerometer with a resolution of 13 bits and a measurement range of ±16g. The digital output data is in 16-bit twos complement format.
For easy use, we provide you with the detailed Mixly code below to test the module.
2. Technical Parameters
- Interface: EASY plug
- Operating voltage: DC 5V
- Measuring range: ±16g
- Communication way: IIC communication protocol
3. Wiring Diagram
4. Import kidsbits library
Begin with the Mixly blocks coding, you should first import the corresponding kidsbits library for those sensor modules.
Connect the control board to your computer using a USB cable.
Then open the Mixly blocks software 0.998, set the board to UNO R3, select your correct COM port. On the upper right corner you can switch the language.
After that, click Import, import the keyes-kidsbits library. Shown below.
If import custom library successfully, you should see the sensor module library shown below.
Click on the display screen block of keyes_kidsbits, you can directly use the corresponding module. Shown below.
5. Test Code
Open the code folder we provided, you are able to directly open or drag the code to Mixly window.
You can click the Code to check the C language.
6. Test Result
Hook it up and upload the code success, open the monitor and set the baud rate to 9600.
The monitor window is showing the acceleration value of X, Y, Z direction. When the module is placed horizontally, the acceleration value in the Z direction of the module is 1g.
If upload failed, how should you do?
1)Check out the board and COM port; make sure that you have selected the proper Board (UNO) and COM port. You can see the COM port matching with that of your computer’s Device Manager.
2)Check out the library folder. Here we can see the problem shown in the prompt window.
Open the library route, and delete the utility folder inside both libraries and hardware folder.
After delete the utility folder, compile and upload the code again.
If still fails, check out the folder route, whether you have deleted the utility folder well.
When you have deleted all the utility folders, compile and upload the test code once again; you should see the code is compiling and uploading successfully.
Well done. Open the serial monitor to check what result you will see.