You have already used a number of sensors, which you connected to the analog pins. You will see now another type of sensor. This digital sensor provides linearized, calibrated signals in I²C format.
You can connect the accelerometer either by SPI or I2C. The easiest way will be the I2C connection. SDA and SCL pins go to the respective ones on the board, GND to Ground and VCC to 3.3V.
Using streams, the code is just as easy to write. For the simplest application, just add a visual node where you will measure and return, in the payload, the acceleration on one of the axis, the one you chose. The visual blocks for the accelerometer can be found under Sensors, in the side menu, in section Accelerometer. There is one slight change you have to make. You don't need the default set block to initialise the sensor. You want the initialisation block, which can be found in the Functions section, under the name Initialise…
So the nodes you are going to use are run , followed by the visual node and then you can send a signal with the value, via the corresponding node, or print it on the screen, using print
You can use it both for temperature and humidity. It is easy to connect to the board, as you see in the example above.
As for the code, you only need a visual node to extract the data from the sensor.
Make sure that when you go under sensors and humidity sensor and drag the initialisation block, you extract only the blue, init block. Instead of putting it inside a set block, you choose from function the initialise block. This way, the values from the sensor will be stable.
In case you want to extract the humidity as well, you can use a change node.
Hint Double check to have the same name of the variable where the sensor was initialised and in the blocks where you take the values.
Now, that you got friends with the sensors, you can make a variety of applications using it.
After you wired correctly and understood how the sensor works, start solving the following exercises,