This setup works:

![enter image description here][1]

One of your items is an arrow, the other is any non-dispensing item like redstone.

Arrows will fire and miss the tripwire. Items will hit it then burn up, triggering a signal. You can use the items you suggested: arrow, cobble, cobble, arrow and the desired signal will be generated (well, the inverse).


  [1]: https://i.sstatic.net/VC6tf.png