The present invention relates to a microdevice (100) for emitting electromagnetic radiation onto an associated object. Simultaneous non-contact spatial control over the microdevice in terms of translational movement in three dimensions, and rotational movement around at least two axes, preferably three axes, is possible. The microdevice further comprises a nanowire (150) being arranged for emitting electromagnetic radiation onto said associated object. This is advantageous for obtaining better spatial control of the microdevice comprising the nanowire, and this enables that light could more effectively be coupled into the nanowire. This opens up for a much wider application of nanowires in optics because of the improved spatial control.