![SeeedStudio ReSpeaker Core v2 Manual Download Page 15](http://html.mh-extra.com/html/seeedstudio/respeaker-core-v2/respeaker-core-v2_manual_1232995015.webp)
sudo apt install python-mraa python-upm libmraa1 libupm1 mraa-tools
Ste p 2. Che ck your platform information
#only have bus 0 and id=03(/dev/i2c-3), 0 is the i2c number for mraa and upm
respeaker@v2:~$ mraa-i2c list
Bus 0: id=03 type=linux
#mraa gpio numbers and system gpio numbers and it's pinmux
respeaker@v2:~$ mraa-gpio list
00 GPIO91: GPIO
01 VCC:
02 GPIO43: GPIO
03 GPIO127: GPIO
04 GPIO17: GPIO
05 GPIO67: GPIO
06 GND:
07 GPIO13: GPIO
08 I2C2_SCL: I2C
09 I2C2_SDA: I2C
10 VCC:
11 GND:
12 GPIO66: GPIO
The description of the PIN def ines f or the ReSpeaker Core V2 board please ref er to [Pin Out]()
Ste p 3. De mos with M RAA or UPM
A. Us e MRAA Library
Control GPIO Dire ctly
Materials
Re Spe ak e r Core v2
Grove - Buzze r
Connect the Grove PIR sensor's
SIG
pin to the ReSpeaker Core v2's header pin
0
w ith jumper. Don't f orget to w ire the VCC and GND at the same time. Then tap the
code below into your console
respeaker@v2:~$ python
Python 2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170118] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mraa
>>> x = mraa.Gpio(0)
>>> x.dir(mraa.DIR_OUT)
0
>>> x.write(0)
0
>>> x.write(1)
0
>>>
When you tap
x.w rite (1)
,you w ill heard a scream f rom the buzzer.
PIR Motion Se ns or e xam ple
Materials
Re Spe ak e r Core v2
Grove - PIR Motion Se ns or