Syd Barrett , the erratically brilliant songwriter and singer who created the psychedelic rock of Pink Floyd only to leave the band in 1968 with mental problems , died on July 7 at his home in Cambridgeshire , England .