Wiki source code of If Raspberry Pi pin [value] is true then ... Else ...
Last modified by admin on 2023/11/02 11:25
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | (% class="box infomessage" %) | ||
2 | ((( | ||
3 | Creates an if-else-query. If the specified Pin is true (a.k.a. high or 1) it will continue the script there, otherwise it will continue with the else-brick beneath. | ||
4 | |||
5 | [[image:if-raspberry-pi-pin.png]] | ||
6 | |||
7 | "Else" will be created automatically. | ||
8 | |||
9 | [[image:else.png]] | ||
10 | |||
11 | "End if" will be created automatically and is always the last brick of the if-else-statement. | ||
12 | |||
13 | [[image:end-if.png]] | ||
14 | ))) | ||
15 | |||
16 | (% class="row" %) | ||
17 | ((( | ||
18 | (% class="col-xs-12 col-sm-6" %) | ||
19 | ((( | ||
20 | (% class="box" %) | ||
21 | ((( | ||
22 | ==== **Beispiel** ==== | ||
23 | |||
24 | This script continuously checks the state of pin 15. If the pin is low (0), e.g. no electricity flows, the object is hidden. Else the object is shown. | ||
25 | |||
26 | **[[image:Bsp_If_Raspberry_Pi_Pin_is.png]]** | ||
27 | ))) | ||
28 | ))) | ||
29 | |||
30 | (% class="col-xs-12 col-sm-6" %) | ||
31 | ((( | ||
32 | (% class="box" %) | ||
33 | ((( | ||
34 | ==== **Ergebnis** ==== | ||
35 | |||
36 | [[[[image:Documentation.BrickDocumentation.BackgroundRequestBrick.WebHome@null4.png||alt="Download"]]>>https://share.catrob.at/pocketcode/project/1ca4e28a-72d0-11eb-a92d-005056a36f47]] | ||
37 | |||
38 | [[image:Gif_Wenn_Raspberry_Pi_Pin_ändert_sich_zu.gif||alt="Gif_Wenn_Raspberry_Pi_Pin_ändert_sich_zu.gif"]] | ||
39 | ))) | ||
40 | ))) | ||
41 | ))) |