User manual

MediaTek LinkIt™ Smart 7688 Developer's Guide
© 2015, 2016 MediaTek Inc.
Page 81
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.
board.digital[13].write(0)
sleep(0.5)
3) Now execute this Python script and you should see following message:
$python ./blink_with_firmata.py
Start blinking D13
If you see the LED on D13 of the LinkIt Smart 7688 Duo blink accordingly, congratulations. You’ve
successfully ran the blink example.
To terminate the Python program, press Ctrl-C.
6.6.5. PyMata Approach
Uploading The Arduino PyMata Sketch
PyMata is a Python interface for the Firmata protocol and it uses its own Firmata sketch.
Therefore you need to install the
PyMata libraries before you start uploading the sketch to
Arduino.
Please make sure you’ve the following:
1) Download PyMata libraries (PyMata-master.zip) to Arduino library folder on your
computer and extract it. For example:
C:\Program Files (x86)\Arduino\libraries\
2) Open Arduino IDE and select Sketch > Include library > Add .ZIP Library
3) Select the PyMata-master.zip file and click OK.
Using FirmataPlus Example
Now youre ready to set up Arduino to listen for Firmata commands from the Serial port.
1) Open the Arduino IDE 1.6.4 or 1.6.5
2) In Arduino IDE, open the example File > Examples > FirmataPlus > FirmataPlus
This built-in example is for Arduino Uno, which uses
Serial as Serial port.
However, LinkIt Smart 7688 Duo uses
Serial1 to communicate with OpenWrt.
Therefore, you’ll need to change the listening port of this example from
Serial to Serial1. Find the following line in the example:
Firmata.begin(57600);
3) And change it to
Serial1.begin(57600);
Firmata.begin(Serial1);