IO Pin State Detection Demo

IO Pin State Detection Demo for the Propeller 2
Share this object
<

Overview

Content

One method to check the pin state of an IO pin is to drive the pin in either direction (high/low) using the P2 smart-pin weak drive feature, and then test the signal level to determine if an external signal is pulling the IO pin in either direction.

The attached demo uses a method called "check_pinstate" and shows the result on the P2 Edge Module on-board LEDs

Tips:

  • When using the P2-EC Edge module, make sure the LED dipswitch is turned on.
  • If using the P2-EC32MB Edge module, adjust the code to use LED pins 38 & 39 (instead of 56 and 57)
  • If using the P2-EVAL board, the LED state will be inverted!

This code was written with: Simple Tools IDE version 0.40.0


Downloads  
Zip archive download

Leave a Reply