NEWS
Blockly Schleife am GPIO Pin vom RPI.
-
Hallo knopers1
Probiere es mal so.

Export:
! ````
<xml xmlns="http://www.w3.org/1999/xhtml"><block type="on" id=";q/.LTbkOqHb5{2bWJS8" x="88" y="37"><field name="OID">Object ID</field>
<field name="CONDITION">true</field><statement name="STATEMENT"><block type="variables_set" id="8)*UM%ssIY4]cl?JG{RJ"><field name="VAR">zaehler</field> <value name="VALUE"><block type="math_number" id="]ef5SYV26!4mP{{{-l^^"><field name="NUM">0</field></block></value> <next><block type="comment" id=";dB-iJCvrFX#Nti|VduR"><field name="COMMENT">jede Sekunde ausführen</field> <next><block type="schedule_create" id="7YW(GFC|3w8At73kH9Ll"><field name="NAME">schedule</field> <value name="SCHEDULE"><shadow type="field_cron" id="iCv]P/jck;daB8PHsv:N"><field name="CRON">* * * * * *</field></shadow></value> <statement name="STATEMENT"><block type="comment" id="h4gP}9C#%.[%2y=kbF`]"><field name="COMMENT">10x blinken</field> <next><block type="math_change" id="DoL@{K#@7,~o##`!l^+}"><field name="VAR">zaehler</field> <value name="DELTA"><shadow type="math_number" id="dCStYpx.|_{]0akWy}lp"><field name="NUM">1</field></shadow></value> <next><block type="controls_if" id="*qr+b2)!djax20P_:#t."><mutation else="1"></mutation> <value name="IF0"><block type="logic_compare" id="JH[#Spr1hlZ;6jM5pQt."><field name="OP">GT</field> <value name="A"><block type="variables_get" id="/9-D?8rl),9h^`HKdVP("><field name="VAR">zaehler</field></block></value> <value name="B"><block type="math_number" id=")3MuM(dan%|N6VLx(D4~"><field name="NUM">10</field></block></value></block></value> <statement name="DO0"><block type="schedule_clear" id="A:#M8^UIxz5mF+m12%!`"><field name="NAME">schedule</field></block></statement> <statement name="ELSE"><block type="comment" id="4?c%{LmnK7`}3VRAc2]3"><field name="COMMENT">einschalten</field> <next><block type="control" id="jU:X1l:_T?rouW=h+vHA"><mutation delay_input="false"></mutation> <field name="OID">Object ID</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="logic_boolean" id="J!]au?B|bA]l@C;DG/2o"><field name="BOOL">TRUE</field></block></value> <next><block type="comment" id="0Sqs}3}^}Mm%Zd14!hn="><field name="COMMENT">ausschalten</field> <next><block type="comment" id="PL12o02P`Tl7~17/(1*`"><field name="COMMENT">Verzögerung kleiner 1 Sekunde</field> <next><block type="control" id="8gj)ckTtkjj+p.K8t|T_"><mutation delay_input="true"></mutation> <field name="OID">Object ID</field> <field name="WITH_DELAY">TRUE</field> <field name="DELAY_MS">500</field> <field name="UNIT">ms</field> <field name="CLEAR_RUNNING">FALSE</field> <value name="VALUE"><block type="logic_boolean" id="SQ}g@Kp`vB:S*^TU%ze3"><field name="BOOL">FALSE</field></block></value></block></next></block></next></block></next></block></next></block></statement></block></next></block></next></block></statement></block></next></block></next></block></statement></block></xml>! Grüße
! ```` -
Das ist in etwa das was ich vorgeschlagen hab, nur mit Zähler statt Uhrzeit und Schedule statt Intervall ;)
Würde allerdings tatsächlich ein Intervall verwenden, da das etwas weniger Overhead hat. `
Ja, hast Recht.Ich war gerade mit dem Schedule am "spielen" und hatte da die Idee.
Und warum einfach wenn es auch kompliziert geht :D :D
Grüße
-
Hier die einfachere (und bessere :oops: ) Version von AlCalzone.

Export:
! ````
<xml xmlns="http://www.w3.org/1999/xhtml"><block type="on" id=";q/.LTbkOqHb5{2bWJS8" x="38" y="-13"><field name="OID">Object ID</field>
<field name="CONDITION">true</field><statement name="STATEMENT"><block type="variables_set" id="8)*UM%ssIY4]cl?JG{RJ"><field name="VAR">zaehler</field> <value name="VALUE"><block type="math_number" id="]ef5SYV26!4mP{{{-l^^"><field name="NUM">0</field></block></value> <next><block type="comment" id=";dB-iJCvrFX#Nti|VduR"><field name="COMMENT">Intervall starten</field> <next><block type="timeouts_setinterval" id="HWQqXWP|VsT+Fz*Ab+|@"><field name="NAME">Intervall</field> <field name="INTERVAL">1000</field> <field name="UNIT">ms</field> <statement name="STATEMENT"><block type="comment" id="h4gP}9C#%.[%2y=kbF`]"><field name="COMMENT">10x blinken</field> <next><block type="math_change" id="DoL@{K#@7,~o##`!l^+}"><field name="VAR">zaehler</field> <value name="DELTA"><shadow type="math_number" id="dCStYpx.|_{]0akWy}lp"><field name="NUM">1</field></shadow></value> <next><block type="controls_if" id="*qr+b2)!djax20P_:#t."><mutation else="1"></mutation> <value name="IF0"><block type="logic_compare" id="JH[#Spr1hlZ;6jM5pQt."><field name="OP">GT</field> <value name="A"><block type="variables_get" id="/9-D?8rl),9h^`HKdVP("><field name="VAR">zaehler</field></block></value> <value name="B"><block type="math_number" id=")3MuM(dan%|N6VLx(D4~"><field name="NUM">10</field></block></value></block></value> <statement name="DO0"><block type="timeouts_clearinterval" id="H-qSL3prj3YmbW5`kn+w"><field name="NAME">Intervall</field></block></statement> <statement name="ELSE"><block type="comment" id="4?c%{LmnK7`}3VRAc2]3"><field name="COMMENT">einschalten</field> <next><block type="control" id="jU:X1l:_T?rouW=h+vHA"><mutation delay_input="false"></mutation> <field name="OID">Object ID</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="logic_boolean" id="J!]au?B|bA]l@C;DG/2o"><field name="BOOL">TRUE</field></block></value> <next><block type="comment" id="0Sqs}3}^}Mm%Zd14!hn="><field name="COMMENT">ausschalten</field> <next><block type="comment" id="PL12o02P`Tl7~17/(1*`"><field name="COMMENT">Verzögerung kleiner Intervall Zeit!!!</field> <next><block type="control" id="8gj)ckTtkjj+p.K8t|T_"><mutation delay_input="true"></mutation> <field name="OID">Object ID</field> <field name="WITH_DELAY">TRUE</field> <field name="DELAY_MS">500</field> <field name="UNIT">ms</field> <field name="CLEAR_RUNNING">FALSE</field> <value name="VALUE"><block type="logic_boolean" id="SQ}g@Kp`vB:S*^TU%ze3"><field name="BOOL">FALSE</field></block></value></block></next></block></next></block></next></block></next></block></statement></block></next></block></next></block></statement></block></next></block></next></block></statement></block></xml>! ````
Grüße
-
wie vermutet, es geht….. Leider prellt mein Taster ein wenig. Dies hat zu folge, dass die Intervalle zu oft ausgelöst werden. Dann blinkt es nur noch etweder zu kurz, oder ungleichmäßig... Für den Schalterbetrieb wird hierbei ein Pulldown benötigt. Aber wenn ich ein BM als trigger nehme, sollte es keine Probleme bereiten.
-
wie vermutet, es geht….. Leider prellt mein Taster ein wenig. Dies hat zu folge, dass die Intervalle zu oft ausgelöst werden. `
Ein "stoppe Intervall" zu Beginn des Triggers könnte das beheben. Wobei dann der Zähler zu oft zurückgesetzt wird. Sauber wäre:Wenn Intervall NICHT läuft, dann:
-
setze Zähler auf 0
-
starte Intervall
Aber kein Plan wie das mit Klickibunti geht, das kann ich nur in Textform ;)
-
-
Wenn Intervall NICHT läuft, dann:
-
setze Zähler auf 0
-
starte Intervall `
Bei "KlickiBunti" geht das leider (noch) nicht. ;)
"KlickiBunti-Leute" müssen da schon mal nachdenken. :D
So sollte die Taste entprellt werden.

Export:
! ````
<xml xmlns="http://www.w3.org/1999/xhtml"><block type="comment" id="#{k%e[{to01DQ.UohMC" x="37" y="-62"><field name="COMMENT">Initialisierung bei Scriptstart</field> <next><block type="variables_set" id="cY|8twokXAk|tCx52]m"><field name="VAR">zaehler</field>
<value name="VALUE"><block type="math_number" id="~hs.|8i{sszJUGJb!~Sg"><field name="NUM">0</field></block></value>
<next><block type="variables_set" id="(=M+iT3_#LPC4PRUFOj"><field name="VAR">TimerOn</field> <value name="VALUE"><block type="logic_boolean" id="LN,C1@WJT0|UKvUNmWB"><field name="BOOL">FALSE</field></block></value>
<next><block type="comment" id="Bvitj`3,WuzK:vgIZwr{"><field name="COMMENT">Triggern</field>
<next><block type="on" id=";q/.LTbkOqHb5{2bWJS8"><field name="OID">Object ID</field>
<field name="CONDITION">true</field><statement name="STATEMENT"><block type="controls_if" id="/:PVKStC^F(xsisHri7k"><value name="IF0"><block type="logic_compare" id="?I-0QT~eAMMB6h.@06o4"><field name="OP">EQ</field> <value name="A"><block type="variables_get" id="6Vye,dz+3CM#t#}Q,9MG"><field name="VAR">TimerOn</field></block></value> <value name="B"><block type="logic_boolean" id="]D},%3E65Tf%jDYJC3!x"><field name="BOOL">FALSE</field></block></value></block></value> <statement name="DO0"><block type="comment" id=";dB-iJCvrFX#Nti|VduR"><field name="COMMENT">Intervall starten</field> <next><block type="variables_set" id="XMkaY]a71BOr=x[%kJPo"><field name="VAR">TimerOn</field> <value name="VALUE"><block type="logic_boolean" id="R?wJI^Ea|BLUFdk[?`PB"><field name="BOOL">TRUE</field></block></value> <next><block type="timeouts_setinterval" id="HWQqXWP|VsT+Fz*Ab+|@"><field name="NAME">Intervall</field> <field name="INTERVAL">1000</field> <field name="UNIT">ms</field> <statement name="STATEMENT"><block type="comment" id="h4gP}9C#%.[%2y=kbF`]"><field name="COMMENT">10x blinken</field> <next><block type="math_change" id="DoL@{K#@7,~o##`!l^+}"><field name="VAR">zaehler</field> <value name="DELTA"><shadow type="math_number" id="dCStYpx.|_{]0akWy}lp"><field name="NUM">1</field></shadow></value> <next><block type="controls_if" id="*qr+b2)!djax20P_:#t."><mutation else="1"></mutation> <value name="IF0"><block type="logic_compare" id="JH[#Spr1hlZ;6jM5pQt."><field name="OP">GT</field> <value name="A"><block type="variables_get" id="/9-D?8rl),9h^`HKdVP("><field name="VAR">zaehler</field></block></value> <value name="B"><block type="math_number" id=")3MuM(dan%|N6VLx(D4~"><field name="NUM">10</field></block></value></block></value> <statement name="DO0"><block type="variables_set" id=",NvX2rG]TWUe?lDK#7?f"><field name="VAR">zaehler</field> <value name="VALUE"><block type="math_number" id="J12u.l:9VqNV+A@%LrH8"><field name="NUM">0</field></block></value> <next><block type="variables_set" id="FAv+kZB=iiO_HMV2ADXi"><field name="VAR">TimerOn</field> <value name="VALUE"><block type="logic_boolean" id=",}mPhyQ=*S=vmo1n!w`k"><field name="BOOL">FALSE</field></block></value> <next><block type="timeouts_clearinterval" id="H-qSL3prj3YmbW5`kn+w"><field name="NAME">Intervall</field></block></next></block></next></block></statement> <statement name="ELSE"><block type="comment" id="4?c%{LmnK7`}3VRAc2]3"><field name="COMMENT">einschalten</field> <next><block type="control" id="jU:X1l:_T?rouW=h+vHA"><mutation delay_input="false"></mutation> <field name="OID">Object ID</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="logic_boolean" id="J!]au?B|bA]l@C;DG/2o"><field name="BOOL">TRUE</field></block></value> <next><block type="comment" id="0Sqs}3}^}Mm%Zd14!hn="><field name="COMMENT">ausschalten</field> <next><block type="comment" id="PL12o02P`Tl7~17/(1*`"><field name="COMMENT">Verzögerung kleiner Intervall Zeit!!!</field> <next><block type="control" id="8gj)ckTtkjj+p.K8t|T_"><mutation delay_input="true"></mutation> <field name="OID">Object ID</field> <field name="WITH_DELAY">TRUE</field> <field name="DELAY_MS">500</field> <field name="UNIT">ms</field> <field name="CLEAR_RUNNING">FALSE</field> <value name="VALUE"><block type="logic_boolean" id="SQ}g@Kp`vB:S*^TU%ze3"><field name="BOOL">FALSE</field></block></value></block></next></block></next></block></next></block></next></block></statement></block></next></block></next></block></statement></block></next></block></next></block></statement></block></statement></block></next></block></next></block></next></block></next></block></xml>! ````
Grüße
-