SPL GPIO OutputPort programming - How to start GPIO OutputPort programming


1. Add "clear" command
  1. Add "clear" command to clear screen.



      
    clear
    
      
 



2. Add "OutputPort" command
  1. Double click "OutputPort" item on the tree.



      
    clear
    
    OutputPort    port6
    	/Pin:6
    	/InitialState:false
    
      


  2. You can change Pin number as one of between 5 ~ 10.

  3. You can change InitialState as true.



3. Add simple logic to read current state of port
  1. You can read current state of port by using below method.

       portname.Read()

  2. 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
  1. if SPL emulator is running, please terminate emulator.

  2. Press "F5" key to re-launch SPL emulator on the editor.




5. Send SPL script to emulator
  1. Click "Send Script" button to send SPL script to emulator



  2. Executed result will be shown as follows.