Skip to content

Commit 64e8861

Browse files
luoweiyuanlbuque
authored andcommitted
docs: Fix some example error.
Signed-off-by: luoweiyuan <luoweiyuan@m5stack.com>
1 parent 8cc0ea7 commit 64e8861

7 files changed

Lines changed: 10 additions & 10 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"V2.0","versionNumber":"V2.3.7","type":"dualkey","components":[],"resources":[{"hardware":["hardware_button","hardware_pin_button","rgb","hardware_dualkey"]}],"units":[],"hats":[],"caps":[],"bases":[],"i2cs":[],"blockly":"<variables><variable id=\"G]9L|h-p_;OilyCUrNjr\">led1_state</variable><variable id=\"6tb5k(*BYNsW5X{ngI9N\">led2_state</variable></variables><block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"50\" y=\"50\"><mutation isBegin=\"true\"></mutation><field name=\"UPDATEOP\">true</field><statement name=\"FUNC\"><block type=\"system_m5_begin\" id=\"s]zt3BAB]4XcR}Gb;/wv\"><next><block type=\"rgb_init\" id=\"$XE$^]?+-B/_$;OAVGLX\"><mutation mode=\"builtin\"></mutation><field name=\"MODE\">builtin</field><next><block type=\"rgb_set_index_color\" id=\"63E!3Ytr66B:(nTN2xBF\"><field name=\"NAME\">rgb</field><value name=\"INDEX\"><shadow type=\"math_number\" id=\"!Fl2;|q[gs@}S4@4})+r\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">0</field></shadow></value><value name=\"COLOR\"><block type=\"color_rgb_palette\" id=\"Y6$oO/@/J,~/wG{mp6h]\"><mutation mode=\"palette\"></mutation><field name=\"MODE\">palette</field><field name=\"COLOR\">#33ccff</field></block></value><next><block type=\"rgb_set_index_color\" id=\"L:c1A:*9ygo|Idjp9+:T\"><field name=\"NAME\">rgb</field><value name=\"INDEX\"><shadow type=\"math_number\" id=\"rtUMZC;]j=!/e0iD~K#i\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">1</field></shadow></value><value name=\"COLOR\"><block type=\"color_rgb_palette\" id=\"qcfekle,.zlx=yH#Y,~x\"><mutation mode=\"palette\"></mutation><field name=\"MODE\">palette</field><field name=\"COLOR\">#33ccff</field></block></value></block></next></block></next></block></next></block></statement></block><block type=\"basic_on_loop\" id=\"loop_block\" deletable=\"false\" x=\"450\" y=\"50\"><mutation isUpdate=\"true\"></mutation><field name=\"UPDATEOP\">true</field><statement name=\"FUNC\"><block type=\"system_m5_update\" id=\"O.^Cda~dQ!?_O#BVdy==\"></block></statement></block><block type=\"button_callback\" id=\"TJE|l*wIYP,6+lGrq`Fr\" x=\"50\" y=\"310\"><field name=\"NAME\">BtnA</field><field name=\"TYPE\">WAS_CLICKED</field><statement name=\"FUNC\"><block type=\"text_print\" id=\"H^?r}/^dm-XvP?Gjguu#\"><value name=\"TEXT\"><shadow type=\"text\" id=\"5Hx|*%YI/k9Xw,?oj/r3\"><field name=\"TEXT\">clicke left</field></shadow></value><next><block type=\"variables_set\" id=\"Jxh,hlFU|Dy}CN+#D0Ft\"><field name=\"VAR\" id=\"G]9L|h-p_;OilyCUrNjr\">led1_state</field><value name=\"VALUE\"><block type=\"logic_negate\" id=\"~%!5uG{LMeDkLM@0%l%X\"><value name=\"BOOL\"><block type=\"variables_get\" id=\"s6D=,%WE_c}iD2tHIO%H\"><field name=\"VAR\" id=\"G]9L|h-p_;OilyCUrNjr\">led1_state</field></block></value></block></value><next><block type=\"controls_if\" id=\"h2p{%#gr7}6vc_{4!X.X\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"variables_get\" id=\"f(ye~DvBvj[e4km+WyzO\"><field name=\"VAR\" id=\"G]9L|h-p_;OilyCUrNjr\">led1_state</field></block></value><statement name=\"DO0\"><block type=\"rgb_set_index_color\" id=\"G]JU(%g~m;)`S_5[;[F;\"><field name=\"NAME\">rgb</field><value name=\"INDEX\"><shadow type=\"math_number\" id=\"5SzmHV]I=xb*F|XvEp(d\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">0</field></shadow></value><value name=\"COLOR\"><block type=\"color_rgb_palette\" id=\"EXY$L2o(/]K4Sap+HR#b\"><mutation mode=\"palette\"></mutation><field name=\"MODE\">palette</field><field name=\"COLOR\">#009900</field></block></value></block></statement><statement name=\"ELSE\"><block type=\"rgb_set_index_color\" id=\"*nehm1UznJlR8z86BF.Z\"><field name=\"NAME\">rgb</field><value name=\"INDEX\"><shadow type=\"math_number\" id=\"C(*}yL%/Pmn#|G$T5v60\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">0</field></shadow></value><value name=\"COLOR\"><block type=\"color_rgb_palette\" id=\"?tRsr5.hOFmwyD;aE`j8\"><mutation mode=\"palette\"></mutation><field name=\"MODE\">palette</field><field name=\"COLOR\">#000000</field></block></value></block></statement></block></next></block></next></block></statement></block><block type=\"button_callback\" id=\"U0CB8r,eYSV3W-gx*,G(\" x=\"50\" y=\"590\"><field name=\"NAME\">BtnB</field><field name=\"TYPE\">WAS_CLICKED</field><statement name=\"FUNC\"><block type=\"text_print\" id=\"}A=)[/A,fYcmbl~~s4HH\"><value name=\"TEXT\"><shadow type=\"text\" id=\"!QC034e1|Iqr%8nqt3+u\"><field name=\"TEXT\">click right</field></shadow></value><next><block type=\"variables_set\" id=\"er7oBEq0)MAJetPs3#b_\"><field name=\"VAR\" id=\"6tb5k(*BYNsW5X{ngI9N\">led2_state</field><value name=\"VALUE\"><block type=\"logic_negate\" id=\"63iML{[:h4Qv{gBVWzSX\"><value name=\"BOOL\"><block type=\"variables_get\" id=\"{#}[XW^0}#jW/-4$GU8w\"><field name=\"VAR\" id=\"6tb5k(*BYNsW5X{ngI9N\">led2_state</field></block></value></block></value><next><block type=\"controls_if\" id=\"9AQ9B2+LR:BOQ@jUf[+P\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"variables_get\" id=\"9Zkn7R`5?m+vYUt@s[^?\"><field name=\"VAR\" id=\"6tb5k(*BYNsW5X{ngI9N\">led2_state</field></block></value><statement name=\"DO0\"><block type=\"rgb_set_index_color\" id=\"hOb/TdKU6/VjR5Y^LMTD\"><field name=\"NAME\">rgb</field><value name=\"INDEX\"><shadow type=\"math_number\" id=\"YPEkcD!9mEKI:1XW?|8;\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">1</field></shadow></value><value name=\"COLOR\"><block type=\"color_rgb_palette\" id=\"SvH$hNReMmW`X?+zK`Ko\"><mutation mode=\"palette\"></mutation><field name=\"MODE\">palette</field><field name=\"COLOR\">#009900</field></block></value></block></statement><statement name=\"ELSE\"><block type=\"rgb_set_index_color\" id=\"h(p!sWCI=xO*Mst.Gb[#\"><field name=\"NAME\">rgb</field><value name=\"INDEX\"><shadow type=\"math_number\" id=\"1#4/=2U|d[?}tn_U|j1l\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">1</field></shadow></value><value name=\"COLOR\"><block type=\"color_rgb_palette\" id=\"A(ItwcGMr8-[*}6W,:JR\"><mutation mode=\"palette\"></mutation><field name=\"MODE\">palette</field><field name=\"COLOR\">#000000</field></block></value></block></statement></block></next></block></next></block></statement></block>","screen":[],"logicWhenNum":0,"customList":[]}
1+
{"version":"V2.0","versionNumber":"V2.3.8","type":"dualkey","components":[],"resources":[{"hardware":["hardware_button","hardware_pin_button","rgb","hardware_dualkey"]}],"units":[],"hats":[],"caps":[],"chains":[],"bases":[],"plcmodules":[{"type":"stamplc_ac","name":"stamplc_ac_0","id":"k2$vf%nBCHYLAJUX","createTime":1764204754436,"initBlockType":"stamplc_ac_init","initBlockId":":CzP$@73Y[v[FVcmWl0K"}],"i2cs":[],"chainBus":[],"blockly":"<variables><variable id=\"G]9L|h-p_;OilyCUrNjr\">led1_state</variable><variable id=\"6tb5k(*BYNsW5X{ngI9N\">led2_state</variable></variables><block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"50\" y=\"50\"><mutation isBegin=\"true\"></mutation><field name=\"UPDATEOP\">true</field><statement name=\"FUNC\"><block type=\"system_m5_begin\" id=\"s]zt3BAB]4XcR}Gb;/wv\"><next><block type=\"rgb_init\" id=\"$XE$^]?+-B/_$;OAVGLX\"><mutation mode=\"builtin\"></mutation><field name=\"MODE\">builtin</field><next><block type=\"rgb_set_index_color\" id=\"63E!3Ytr66B:(nTN2xBF\"><field name=\"NAME\">rgb</field><value name=\"INDEX\"><shadow type=\"math_number\" id=\"!Fl2;|q[gs@}S4@4})+r\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">0</field></shadow></value><value name=\"COLOR\"><block type=\"color_rgb_palette\" id=\"Y6$oO/@/J,~/wG{mp6h]\"><mutation mode=\"palette\"></mutation><field name=\"MODE\">palette</field><field name=\"COLOR\">#33ccff</field></block></value><next><block type=\"rgb_set_index_color\" id=\"L:c1A:*9ygo|Idjp9+:T\"><field name=\"NAME\">rgb</field><value name=\"INDEX\"><shadow type=\"math_number\" id=\"rtUMZC;]j=!/e0iD~K#i\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">1</field></shadow></value><value name=\"COLOR\"><block type=\"color_rgb_palette\" id=\"qcfekle,.zlx=yH#Y,~x\"><mutation mode=\"palette\"></mutation><field name=\"MODE\">palette</field><field name=\"COLOR\">#33ccff</field></block></value></block></next></block></next></block></next></block></statement></block><block type=\"basic_on_loop\" id=\"loop_block\" deletable=\"false\" x=\"450\" y=\"50\"><mutation isUpdate=\"true\"></mutation><field name=\"UPDATEOP\">true</field><statement name=\"FUNC\"><block type=\"system_m5_update\" id=\"O.^Cda~dQ!?_O#BVdy==\"></block></statement></block><block type=\"button_callback\" id=\"TJE|l*wIYP,6+lGrq`Fr\" x=\"50\" y=\"310\"><field name=\"NAME\">BtnB</field><field name=\"TYPE\">WAS_CLICKED</field><statement name=\"FUNC\"><block type=\"text_print\" id=\"H^?r}/^dm-XvP?Gjguu#\"><value name=\"TEXT\"><shadow type=\"text\" id=\"5Hx|*%YI/k9Xw,?oj/r3\"><field name=\"TEXT\">clicke left</field></shadow></value><next><block type=\"variables_set\" id=\"Jxh,hlFU|Dy}CN+#D0Ft\"><field name=\"VAR\" id=\"G]9L|h-p_;OilyCUrNjr\">led1_state</field><value name=\"VALUE\"><block type=\"logic_negate\" id=\"~%!5uG{LMeDkLM@0%l%X\"><value name=\"BOOL\"><block type=\"variables_get\" id=\"s6D=,%WE_c}iD2tHIO%H\"><field name=\"VAR\" id=\"G]9L|h-p_;OilyCUrNjr\">led1_state</field></block></value></block></value><next><block type=\"controls_if\" id=\"h2p{%#gr7}6vc_{4!X.X\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"variables_get\" id=\"f(ye~DvBvj[e4km+WyzO\"><field name=\"VAR\" id=\"G]9L|h-p_;OilyCUrNjr\">led1_state</field></block></value><statement name=\"DO0\"><block type=\"rgb_set_index_color\" id=\"G]JU(%g~m;)`S_5[;[F;\"><field name=\"NAME\">rgb</field><value name=\"INDEX\"><shadow type=\"math_number\" id=\"5SzmHV]I=xb*F|XvEp(d\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">0</field></shadow></value><value name=\"COLOR\"><block type=\"color_rgb_palette\" id=\"EXY$L2o(/]K4Sap+HR#b\"><mutation mode=\"palette\"></mutation><field name=\"MODE\">palette</field><field name=\"COLOR\">#009900</field></block></value></block></statement><statement name=\"ELSE\"><block type=\"rgb_set_index_color\" id=\"*nehm1UznJlR8z86BF.Z\"><field name=\"NAME\">rgb</field><value name=\"INDEX\"><shadow type=\"math_number\" id=\"C(*}yL%/Pmn#|G$T5v60\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">0</field></shadow></value><value name=\"COLOR\"><block type=\"color_rgb_palette\" id=\"?tRsr5.hOFmwyD;aE`j8\"><mutation mode=\"palette\"></mutation><field name=\"MODE\">palette</field><field name=\"COLOR\">#000000</field></block></value></block></statement></block></next></block></next></block></statement></block><block type=\"button_callback\" id=\"U0CB8r,eYSV3W-gx*,G(\" x=\"50\" y=\"590\"><field name=\"NAME\">BtnA</field><field name=\"TYPE\">WAS_CLICKED</field><statement name=\"FUNC\"><block type=\"text_print\" id=\"}A=)[/A,fYcmbl~~s4HH\"><value name=\"TEXT\"><shadow type=\"text\" id=\"!QC034e1|Iqr%8nqt3+u\"><field name=\"TEXT\">click right</field></shadow></value><next><block type=\"variables_set\" id=\"er7oBEq0)MAJetPs3#b_\"><field name=\"VAR\" id=\"6tb5k(*BYNsW5X{ngI9N\">led2_state</field><value name=\"VALUE\"><block type=\"logic_negate\" id=\"63iML{[:h4Qv{gBVWzSX\"><value name=\"BOOL\"><block type=\"variables_get\" id=\"{#}[XW^0}#jW/-4$GU8w\"><field name=\"VAR\" id=\"6tb5k(*BYNsW5X{ngI9N\">led2_state</field></block></value></block></value><next><block type=\"controls_if\" id=\"9AQ9B2+LR:BOQ@jUf[+P\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"variables_get\" id=\"9Zkn7R`5?m+vYUt@s[^?\"><field name=\"VAR\" id=\"6tb5k(*BYNsW5X{ngI9N\">led2_state</field></block></value><statement name=\"DO0\"><block type=\"rgb_set_index_color\" id=\"hOb/TdKU6/VjR5Y^LMTD\"><field name=\"NAME\">rgb</field><value name=\"INDEX\"><shadow type=\"math_number\" id=\"YPEkcD!9mEKI:1XW?|8;\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">1</field></shadow></value><value name=\"COLOR\"><block type=\"color_rgb_palette\" id=\"SvH$hNReMmW`X?+zK`Ko\"><mutation mode=\"palette\"></mutation><field name=\"MODE\">palette</field><field name=\"COLOR\">#009900</field></block></value></block></statement><statement name=\"ELSE\"><block type=\"rgb_set_index_color\" id=\"h(p!sWCI=xO*Mst.Gb[#\"><field name=\"NAME\">rgb</field><value name=\"INDEX\"><shadow type=\"math_number\" id=\"1#4/=2U|d[?}tn_U|j1l\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">1</field></shadow></value><value name=\"COLOR\"><block type=\"color_rgb_palette\" id=\"A(ItwcGMr8-[*}6W,:JR\"><mutation mode=\"palette\"></mutation><field name=\"MODE\">palette</field><field name=\"COLOR\">#000000</field></block></value></block></statement></block></next></block></next></block></statement></block>","screen":[],"logicWhenNum":0,"customList":[]}

examples/controllers/dualkey/dualkey_button_led_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
led2_state = None
1414

1515

16-
def btna_was_clicked_event(state):
16+
def btnb_was_clicked_event(state):
1717
global rgb, led1_state, led2_state
1818
print("clicke left")
1919
led1_state = not led1_state
@@ -23,7 +23,7 @@ def btna_was_clicked_event(state):
2323
rgb.set_color(0, 0x000000)
2424

2525

26-
def btnb_was_clicked_event(state):
26+
def btna_was_clicked_event(state):
2727
global rgb, led1_state, led2_state
2828
print("click right")
2929
led2_state = not led2_state

0 commit comments

Comments
 (0)