Hardware Reference
In-Depth Information
}
}
Save this code called
LedDemo
. Compile and deploy this program to the board.
Now we work on SSH Terminal. Create a file, called
leddemo.py
, and write this code.
import
sys
import
time
sys.path.insert(
0
, '/usr/lib/python2.7/bridge/')
from
bridgeclient
import
BridgeClient
as
bridgeclient
client = bridgeclient()
client.begin()
current_val =
0
while
True
:
try
:
client.put('led',
str
(current_val))
print
current_val
if
current_val ==
0
:
current_val =
1
else
:
current_val =
0
time.sleep(
1
)
except
(
KeyboardInterrupt
,
SystemExit
):
client.close()
raise
Now you can run this program.
$
python leddemo.py
The following is a program output on Python app.

