The growing need for clean energy and food production are favoring the use of underused spaces, such as rooftops. This study aims to demonstrate the compatibility of the use of rooftops both for the production of photovoltaic energy and for the production of food, despite the fact that both compete for the same resource, sunlight (rooftop agrivoltaic). In the experiment reported in this study, which was carried out in Almería (Spain) during the spring and summer of 2021, three shade treatments were tested for a lettuce crop, produced by photovoltaic modules with different arrangements: concentrated shade (CS), scattered shade (SS) and full sun (FS). This experiment was repeated in two seasons with high radiation levels and temperature. The results show that in these environmental conditions, the cultivation of plants that demand little sunlight, such as lettuce, is compatible with the shading produced by photovoltaic panels. In addition, it is shown that the same percentage of the area covered with shade (22%), but using mini-PV modules arranged in patterns, improves the productivity (fresh weight, dry matter, number of leaves, maximum length and dry matter of roots) of lettuce cultivation, both in spring and summer.