MEDIATEK LinkIt Smart 7688 Developer's Manual page 80

Hide thumbs Also See for LinkIt Smart 7688:
Table of Contents

Advertisement

This is a Python interface for the Firmata protocol used on the MPU. You can install it
by typing pip install PyMata in the console. At the time of writing, LinkIt Smart 7688
Duo supports version pymata-2.1.
Note: The LinkIt Smart 7688 Duo needs to be in Station mode in order to use pip to install the
pyFirmata and PyMata interface, please see section 4.3.2, "Station Mode" for details on how to set
station mode.
6.6.4.
PyFirmata Approach
Uploading The Arduino Firmata Sketch
This section describes setting up Arduino to listen for Firmata commands from the Serial
port.
Open the
Arduino IDE 1.6.5
1)
In Arduino IDE, open the example
2)
This built-in example is for Arduino Uno, which uses
However, LinkIt Smart 7688 Duo uses
Therefore, you'll need to change the listening port of this example from
Serial to Serial1.F
Firmata.begin(57600);
And change it to:
3)
Serial1.begin(57600);
Firmata.begin(Serial1);
Upload the sketch. After uploading the sketch, Arduino is ready to receive commands
4)
from the Linux side.
Running Your Blink Example Using pyFirmata
pyFirmata
After
In the console, create a python file called
1)
Open the file and copy and paste the following example code. This
2)
modified to work for LinkIt Smart 7688 Duo. For example:
from
pyfirmata
from
time
import
board
=
Arduino('/dev/ttyS0')
print "Start blinking
while
True:
board.digital[13].write(1)
sleep(0.5)
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.
File > Examples > Firmata > StandardFirmata
ind the following line in the example:
is installed, you're ready to run a blink example.
import
Arduino, util
sleep
D13"
© 2015, 2016 MediaTek Inc.
MediaTek LinkIt™ Smart 7688 Developer's Guide
Serial as Serial port
Serial1
to communicate with OpenWrt.
blink_with_firmata.py
.
code is
example
Page 80

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents