In this paper we demonstrate structured illumination microscopy, a cheap and flexible method of obtaining optical sectioning in wide-field microscopy, and we investigate line-scanning microscopy, both using the same microelement LED. In our first experiment we demonstrate structured illumination using a custom-designed microelement LED consisting of 120 individually addressable stripes emitting at 470 mn. An electrical driver was designed to produce a programmable grid pattern and the device was located in an Olympus BX41 fluorescence microscope in critical illumination configuration. By using an integrated solid-state alternative to a conventional piezo-actuated grid and separate illumination source, we improved the speed and accuracy of the system, reducing the artefacts due to the errors in the grid positions. Additionally, we investigated the use of the same LED device as a scanning source for confocal line-scanning microscopy. After each line scanning, an image was acquired using a CCD camera and the out-offocus light was rejected by a post-processing method.