Can anyone tell me what are the uses of a Redstone Comparator?

I am not good with Comparators, I would like the above to be answered so I can fully understand them.


One of the main uses of a comaprator is to test the strength that some blocks give out such as:

Cake, Cauldron, Command Block, End Portal Frame, Item Frame, Jukebox

A redstone comparator can be used to measure the state of a container, and outputs a signal strength in proportion to how full the container is (0 for empty, 15 for full, etc.).

The redstone comparator can take a signal strength input from its rear as well as from both sides. Side inputs are only accepted from redstone blocks, redstone dust, redstone repeaters, and other comparators. The redstone comparator's front is its output.

It takes 1 redstone tick (2 game ticks, or 0.1 seconds barring lag) for signals to move through a redstone comparator, either from the rear or from the sides. This applies to changing signal strengths as well as simply to turning on and off. Redstone comparators usually will not respond to 1-tick fluctuations of power or signal strength — for example, a 1-clock input will be treated as always off from the side, and always on from the rear.

The redstone comparator has four functions: maintain signal strength, compare signal strength, subtract signal strength, and measure certain block states (primarily the fullness of containers).

There is plenty more info on comparators here: http://minecraft.gamepedia.com/Redstone_Comparator

This video talks about the uses of comparators: