Densely arrayed skeletal myotubes are activated individually and as a group using precise optical stimulation with high spatiotemporal resolution. Skeletal muscle myoblasts are genetically encoded to express a light-activated cation channel, Channelrhodopsin-2, which allows for spatiotemporal coordination of a multitude of skeletal myotubes that contract in response to pulsed blue light. Furthermore, ensembles of mature, functional 3D muscle microtissues have been formed from the optogenetically encoded myoblasts using a high-throughput device. The device, called "skeletal muscle on a chip", not only provides the myoblasts with controlled stress and constraints necessary for muscle alignment, fusion and maturation, but also facilitates the measurement of forces and characterization of the muscle tissue. We measured the specific static and dynamic stresses generated by the microtissues and characterized the morphology and alignment of the myotubes within the constructs. The device allows testing of the effect of a wide range of parameters (cell source, matrix composition, microtissue geometry, auxotonic load, growth factors and exercise) on the maturation, structure and function of the engineered muscle tissues in a combinatorial manner. Our studies integrate tools from optogenetics and microelectromechanical systems (MEMS) technology with skeletal muscle tissue engineering to open up opportunities to generate soft robots actuated by a multitude of spatiotemporally coordinated 3D skeletal muscle microtissues.