There is a tutorial on this site for using switches and other items as inputs, written by Perry - have a look for it , it gives you the answers you’ll need and sample code
There is a tutorial on this site for using switches and other items as inputs, written by Perry - have a look for it , it gives you the answers you’ll need and sample code