An ADXL335 is an analog accelerometer that gives the values of acceleration in three axes – X, Y, and Z.
ADXL335
As the ADXL335 has three analog outputs and the NodeMCU has only one analog input – A0, we will use an analog multiplexer (MUX) to allow us to send data from three analog channels to one analog channel. For this project, we will use a 16-channel MUX.
16-channel MUX
Interfacing ADXL335 accelerometer and MUX with NodeMCU
Interfacing ADXL335 accelerometer and MUX with NodeMCU
Final Code
To copy the code, right click on view raw at the bottom of the code, click on open link in new tab and then copy the code.