Hey is this code true for the 220V light bulb ? I don't mention the syntax just the algorithm.(I familiar with C language )
Code:While (1) do 'this creates an infinity loop' { repeat Generator = 1 ' enable sensor power Sensor = GPIO ' read sensor Generator = 0 ' disable sensor power Sensor = Sensor & 7 ' keep only Sensor bits until Sensor != 7 ' ' If the light bulb is lighting we will turn off it when we touch ' else we will turn on. if (LED == 1) LED = 0; else if (LED == 0) LED = 1; }
Bookmarks