Many hybrid devices integrate functional molecular or nanoparticle components with microstructures, as exemplified by the nanophotonic devices that couple emitters to optical resonators for potential use in single-molecule detection, precision magnetometry low threshold lasing and quantum information processing. These systems also illustrate a common difficulty for hybrid devices: although many proof-of-principle devices exist, practical applications face the challenge of how to incorporate large numbers of chemically diverse functional components into microfabricated resonators at precise locations. Here we show that the directed self-assembly of DNA origami onto lithographically patterned binding sites allows reliable and controllable coupling of molecular emitters to photonic crystal cavities (PCCs). The precision of this method is sufficient to enable us to visualize the local density of states within PCCs by simple wide-field microscopy and to resolve the antinodes of the cavity mode at a resolution of about one-tenth of a wavelength. By simply changing the number of binding sites, we program the delivery of up to seven DNA origami onto distinct antinodes within a single cavity and thereby digitally vary the intensity of the cavity emission. To demonstrate the scalability of our technique, we fabricate 65,536 independently programmed PCCs on a single chip. These features, in combination with the widely used modularity of DNA origami, suggest that our method is well suited for the rapid prototyping of a broad array of hybrid nanophotonic devices.