Huang Di,

or the Yellow Emperor (for his imperial color, chosen for the tones of the yellow earth.), is referred to as the "Originator of the Chinese Culture", and all people of the Chinese race regard themselves as descendants of Yan Di and his brother Huang Di.
  Part-real (according to one theory, Huang Di may represents a real leader of a tribal confederation of the Yangshao Neolithic culture), part-legendary (Legend has it that he lived to be 110 years old and then a dragon came and took him back to Heaven where he belonged) persons, they were clan leaders towards the end of China's primitive society (around 4,000 B.C) and lived at the Xuanyuan Hill in the Kunlun Mountains in the west.

The Yellow Emperor was a highly gifted "Son of Heaven". Legend goes that he was the inventor of many things such as making clothes, manufacturing boats and vehicles, building houses and palaces, etc. He is credited with the laws of astronomy and drawing up the first calendar used by the Chinese people. His supposed conversations on diagnosis and treatment with the physician Qi Bo are contained in China's first medical book, Nei Jing (The Yellow Emperor's Canon of Medicine).

The craftsman Fang Bo is credited with actually building the south-pointing chariot.

A pavilion on cypress-covered Mount Qiaoshan in Huangling county on the road north from Xian is Shananxi province marks the place said to be his grave.


A collection of legends written down in the Warring States period ( 475-221 B. C. ) gives this account:

Together with his brother he fought against the invasion of Chi You, the chieftain of the Jiuli Tribe. A decisive battle was fought at Zhuolu in the northwest of the present Hebei Province. At the beginning of the battle, Chiyou sneezed out a thick fog all over the place which lasted three days, and the soldiers of Huang Di could not tell their directions. Fortunately Huang Di led his men out of the fog by the "compass chariot" he had invented and won complete victory.


The same story is related in the Taiping Yulan compiled by Li Feng and others between 977 and 981:

Chi You (described there as a god), skilled maker of weapons and cast bronze with paralleled arrows, axes and spears, took his men to Shangdong and attacked the tribe of Yan Di, driving him into Huang Di's territory around Zhuolu in northwestern Hebei province. The latter was angered and went battle with Chi You.

He was no rival for Chi You and at first suffered several defeats. Chi You conjured up a thick fog which blurred the vision of the Yellow Emperor's men. Luckily the south-pointing chariot helped them know their way. Huang Di also had his men make bugles. There were in Chi You's army many spirits, but they were afraid of the sound of a certain kind of dragon. So the Yellow Emperor had his men make instruments out of animal horns which duplicated this sound and the demons were paralyzed with fear.

Chi You called on a god of wind and rain and blew up a tempest, but Huang Di brought out his daughter who emanated an enormous amount of heat and dried up the storm. Before Chi You's brothers could recover from their surprise Huang Di's forces defeated them.

The last and decisive battle was fought at Zhuolu. Chi You had gone for help to the Kuafu, a clan of giants in the north ( its ancestor was Kuafu who raced with the sun and died of thirst ) and they drove Huang Di back 50 li. But, using strategy learned from the Goddess of the Ninth Heaven, Huang Di finally defeated them. Chi You retreated until he reached what is today's Shanxi, where he was captured by Huang Di's men and beheaded. To make sure the head would not reunite with the body, Huang Di sent it to be buried a thousand li away. (The place where Chi You was beheaded came to be called Xiexian (xie, to sever, and xian, county ) and is still known as that today. Nearby there is a salt lake with water of a reddish color, tinted, people say, by Chi You's blood.)

After the defeat of Chi You, Huang Di became leader of all the tribes on the central plains. He ruled an area stretching east to the sea, west to today's Gansu province, south to the Changjiang (Yangtze) River and north into today's Shanxi and Hebei provinces.



  
Sources:
http://www.span.com.au/100emperors/2.html 
http://www.sh.com/culture/legend/huangdi.htm