Who Invented the First Traffic Light?

The guy who invented the first traffic light is British. His name is J P Knight. He was a railroad engineer that came up with it. It was a lantern with red & green signals. It was put up to make sure noone would get into wrecks.