User Manual
28
Analog Port
The analog port on the PiSmart can convert analog values input to digital ones and output
them. Generally speaking, data like temperature, humidity, etc. in our daily life are all analog
values in the first place. We get the digital value for the temperature and humidity though
AD conversion. In the following part, we will use the Sound Sensor to do a Noise Monitoring
experiment, from which you can better learn how the analog port in PiSmart works.
Noise Monitoring
Use the block in the PiSmart to read the analog values. Connect a Sound Sensor
to the analog port Pin 0, and you can read the digital value converted from the analog one
as shown below.
Create a New Variable
Click the Variables category and then the Make a variable block. You will see a new pop-
up window on the Scripting Area. Input the name for the new variable in the window and
click OK.
After the variable is created, you can find it in the Palette area below the Variables. There
will also be new options when you check the drop-down list, as shown below:
Click the PiSmart and drag out the analog block from the below Palette area, assign the
converted value to the variable voice-value as shown below in the figure:
SunFounder