SPL GPIO TristatePort programming - How to change the function of tristate port from output port to input port
This tutorial is continued from the previous tutorial.
6. Change "Active" property of tristate port
- Change "Active" property of tristate port as "false"
- Click "Send Script" button to send SPL script to emulator.
|
|
|
7. Create emulator script to change the state of tristate port
- Add script to write into GPIO port on the Emulator's editor panel.
- Click "Send Script" button to send SPL script to emulator.
8. Read the state of tristate port in the application
- Execute below script on the editor or emulator's Application command box.
| |
s = port8.Read()
print "Current state is " + s
| |
|
- Send SPL script for application to the emulator.
- Or you can execute above script on the emulator's Application tab directly.
- Executed result will be shown as follows.
|