16.06.2017 Copyright by Joy-IT - Published under CC BY-NC-SA 3.0 Page 83 of 214 KY-020 Tilt switch module Pinout Code example Arduino This example will light up a LED after a sensor detected a signal. the modules KY-011, KY-016 or KY-029 could be used as LED too for example. int Led = 13 ;// D.