Effect of end substitution on electrochemical and optical properties of oligothiophenes