User manual

MediaTek LinkIt™ Smart 7688 Developer's Guide
© 2015, 2016 MediaTek Inc.
Page 82
This document contains information that is proprietary to MediaTek Inc.
Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited.
4) Upload the sketch. After uploading the sketch, Arduino is ready to receive commands
from the Linux side.
Running Blink Example Using PyMata
After youve installed PyMata libraries and changed the serial port in Arduino, youre ready
to run the blink example using PyMata.
1) Download blink example to LinkIt Smart 7688 Duo.
You’ll also need to change the serial port used in this example to work on LinkIt Smart
7688 Duo. Find the following line on the example:
# Create a PyMata instance
board = PyMata("/dev/ttyACM0", verbose=True)
2) And change it to:
# Create a PyMata instance
board = PyMata("/dev/ttyS0", verbose=True)
3) Execute the python script and you should see following output:
$python ./pymata_blink.py
Python Version 2.7.9 (default, Aug 12 2015, 15:09:09)
[GCC 4.8.3]
PyMata version 2.10 Copyright(C) 2013-15 Alan Yorinks All rights
reserved.
Opening Arduino Serial port /dev/ttyS0
Please wait while Arduino is being detected. This can take up to 30
seconds ...
Board initialized in 0 seconds
Total Number of Pins Detected = 30
Total Number of Analog Pins Detected = 12
Blinking LED on pin 13 for 10 times ...
1
2
3
4
5
6
7
8
9
10
PyMata close(): Calling sys.exit(0): Hope to see you soon!