An epoxy-matrix composite with continuous crossply carbon fibers was found to be a semiconductor in the through-thickness direction, with a tunable energy gap of - eV (infrared). The higher the pressure during composite fabrication by lamination, the higher the interlaminar stress and the greater the energy gap, which is the activation energy for electron jumping from one lamina to the adjacent one in the composite. The semiconducting behavior involves the contact electrical resistivity between adjacent laminae in the composite decreasing reversibly with increasing temperature. The concept of optoelectronic and electronic devices made from carbon fiber polymer-matrix composites is provided. Devices include solar cells, light emitting diodes, lasers, infrared detectors and transistors. Thus, a new dimension is added to smart structures and a new field of electronics (`structural electronics') is born.