2 relay module raspberry pi Control a lamp with a Raspberry PI using a Webpage If you landed here, this is part two of a three parts tutorial on how to control a lamp using a Raspberry PI and a relay – this part uses Flask (a web framework for Python) to control the lamp (by controlling the relay). Here are the other parts of