This setup works:
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).