MEDIATEK LinkIt Smart 7688 Developer's Manual page 64

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

Advertisement

root@myLinkIt:~/app#
In the
2)
following command.
vim blink.py
Press i to insert the below codes in the editor. For example:
3)
import
mraa
import
time
# Refer to the pinout digram for the GPIO number to silk print mapping
# in this example the number 44 maps to Wi-Fi LED
led
=
mraa.Gpio(44)
led.dir(mraa.DIR_OUT)
while
True:
led.write(1)
time.sleep(1)
led.write(0)
time.sleep(1)
Press :wq! to save the
4)
Now you're ready to run this Python application. In the app directory, type following
5)
command to run the app:
python ./blink.py
The W-Fi LED on LinkIt Smart 7688 should blink every second.
Press <Ctrl> C to terminate the Python program.
5.1.5.
LED blink example using mraa in LinkIt Smart 7688 GPIO in Node.js
This example shows you how to use mraa library in Node.js to make the Wi-Fi LED on LinkIt Smart
7688 blink.
Connect to LinkIt Smart 7688 console using SSH. In the system console, create a directory
6)
app and then switch into the directory. For example:
called
mkdir app
cd app
NPM
Use
to initialize your file. NPM is a package manager for Node.js and is pre-installed
7)
in LinkIt Smart 7688. You can install it from
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.
MediaTek LinkIt™ Smart 7688 Developer's Guide
prompt, create a file named blink.py by entering the
# set direction to output
# turn on LED
# turn off LED
blink.py
file.
here
© 2015, 2016 MediaTek Inc.
just in case.
Page 64

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents