SPL GPIO OutputPort programming - How to start GPIO OutputPort programming
1. Add "clear" command
- Add "clear" command to clear screen.
|
|
|
2. Add "OutputPort" command
- Double click "OutputPort" item on the tree.
| |
clear
OutputPort port6
/Pin:6
/InitialState:false
| |
|
- You can change Pin number as one of between 5 ~ 10.
- You can change InitialState as true.
3. Add simple logic to read current state of port
- You can read current state of port by using below method.
portname.Read()
- Add lines to read and print current state of port.
| |
clear
OutputPort port6
/Pin:6
/InitialState:false
s = port6.Read()
print "Current state is " + s
| |
|
4. Re-launch SPL emulator
- if SPL emulator is running, please terminate emulator.
- Press "F5" key to re-launch SPL emulator on the editor.
5. Send SPL script to emulator
- Click "Send Script" button to send SPL script to emulator
- Executed result will be shown as follows.
|