diff --git a/demo/stm32g030c8/MDK-ARM/stm32g030c8.uvprojx b/demo/stm32g030c8/MDK-ARM/stm32g030c8.uvprojx index 346b52506..b0999ba1c 100644 --- a/demo/stm32g030c8/MDK-ARM/stm32g030c8.uvprojx +++ b/demo/stm32g030c8/MDK-ARM/stm32g030c8.uvprojx @@ -313,7 +313,7 @@ 1 - 5 + 7 0 0 1 diff --git a/demo/stm32g030c8/pikascript/PikaPiZero.py b/demo/stm32g030c8/pikascript/PikaPiZero.py index 52ebf312c..e909843d2 100644 --- a/demo/stm32g030c8/pikascript/PikaPiZero.py +++ b/demo/stm32g030c8/pikascript/PikaPiZero.py @@ -16,4 +16,6 @@ class RGB(PikaStdLib.SysObj): pass def white(): pass + def flow(): + pass diff --git a/demo/stm32g030c8/pikascript/main.py b/demo/stm32g030c8/pikascript/main.py index d139d4566..11924ca8a 100644 --- a/demo/stm32g030c8/pikascript/main.py +++ b/demo/stm32g030c8/pikascript/main.py @@ -18,11 +18,5 @@ mem = PikaStdLib.MemChecker() print('mem max:') mem.max() while True: - time.sleep_ms(250) - rgb.red() - time.sleep_ms(250) - rgb.green() - time.sleep_ms(250) - rgb.white() - time.sleep_ms(250) - rgb.blue() + time.sleep_ms(50) + rgb.flow() diff --git a/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB-api.c b/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB-api.c index 397927fb1..1f690cd36 100644 --- a/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB-api.c +++ b/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB-api.c @@ -16,6 +16,10 @@ void PikaPiZero_RGB_enableMethod(PikaObj *self, Args *args){ PikaPiZero_RGB_enable(self); } +void PikaPiZero_RGB_flowMethod(PikaObj *self, Args *args){ + PikaPiZero_RGB_flow(self); +} + void PikaPiZero_RGB_greenMethod(PikaObj *self, Args *args){ PikaPiZero_RGB_green(self); } @@ -38,6 +42,7 @@ PikaObj *New_PikaPiZero_RGB(Args *args){ obj_newObj(self, "pin", "STM32_GPIO"); class_defineMethod(self, "blue()", PikaPiZero_RGB_blueMethod); class_defineMethod(self, "enable()", PikaPiZero_RGB_enableMethod); + class_defineMethod(self, "flow()", PikaPiZero_RGB_flowMethod); class_defineMethod(self, "green()", PikaPiZero_RGB_greenMethod); class_defineMethod(self, "init()", PikaPiZero_RGB_initMethod); class_defineMethod(self, "red()", PikaPiZero_RGB_redMethod); diff --git a/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB.h b/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB.h index 095c7bee4..098fff4b5 100644 --- a/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB.h +++ b/demo/stm32g030c8/pikascript/pikascript-api/PikaPiZero_RGB.h @@ -11,6 +11,7 @@ PikaObj *New_PikaPiZero_RGB(Args *args); void PikaPiZero_RGB_blue(PikaObj *self); void PikaPiZero_RGB_enable(PikaObj *self); +void PikaPiZero_RGB_flow(PikaObj *self); void PikaPiZero_RGB_green(PikaObj *self); void PikaPiZero_RGB_init(PikaObj *self); void PikaPiZero_RGB_red(PikaObj *self); diff --git a/demo/stm32g030c8/pikascript/pikascript-api/compiler-info.txt b/demo/stm32g030c8/pikascript/pikascript-api/compiler-info.txt index c3fb52afb..a27212ad1 100644 --- a/demo/stm32g030c8/pikascript/pikascript-api/compiler-info.txt +++ b/demo/stm32g030c8/pikascript/pikascript-api/compiler-info.txt @@ -1 +1 @@ -Compiler { dist_path: "pikascript-api/", source_path: "", class_list: {"PikaMain": ClassInfo { this_class_name: "PikaMain", super_class_name: "PikaStdLib_SysObj", method_list: {}, object_list: {"mem": ObjectInfo { class_name: "PikaMain", name: "mem", import_class_name: "PikaStdLib_MemChecker" }, "rgb": ObjectInfo { class_name: "PikaMain", name: "rgb", import_class_name: "PikaPiZero_RGB" }, "time": ObjectInfo { class_name: "PikaMain", name: "time", import_class_name: "STM32_Time" }, "uart": ObjectInfo { class_name: "PikaMain", name: "uart", import_class_name: "STM32_UART" }}, import_list: {}, script_list: Script { content: " obj_run(pikaMain, \"uart.init()\");\r\n obj_run(pikaMain, \"uart.setId(1)\");\r\n obj_run(pikaMain, \"uart.enable()\");\r\n obj_run(pikaMain, \"print('initing rgb...')\");\r\n obj_run(pikaMain, \"rgb.init()\");\r\n obj_run(pikaMain, \"rgb.enable()\");\r\n obj_run(pikaMain, \"print('init rgb ok!')\");\r\n obj_run(pikaMain, \"print('mem max:')\");\r\n obj_run(pikaMain, \"mem.max()\");\r\n obj_run(pikaMain, \"while True:\");\r\n obj_run(pikaMain, \" time.sleep_ms(250)\");\r\n obj_run(pikaMain, \" rgb.red()\");\r\n obj_run(pikaMain, \" time.sleep_ms(250)\");\r\n obj_run(pikaMain, \" rgb.green()\");\r\n obj_run(pikaMain, \" time.sleep_ms(250)\");\r\n obj_run(pikaMain, \" rgb.white()\");\r\n obj_run(pikaMain, \" time.sleep_ms(250)\");\r\n obj_run(pikaMain, \" rgb.blue()\");\r\n" } }, "PikaPiZero_RGB": ClassInfo { this_class_name: "PikaPiZero_RGB", super_class_name: "PikaStdLib_SysObj", method_list: {"blue": MethodInfo { class_name: "PikaPiZero_RGB", name: "blue", arg_list: None, return_type: None }, "enable": MethodInfo { class_name: "PikaPiZero_RGB", name: "enable", arg_list: None, return_type: None }, "green": MethodInfo { class_name: "PikaPiZero_RGB", name: "green", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaPiZero_RGB", name: "init", arg_list: None, return_type: None }, "red": MethodInfo { class_name: "PikaPiZero_RGB", name: "red", arg_list: None, return_type: None }, "white": MethodInfo { class_name: "PikaPiZero_RGB", name: "white", arg_list: None, return_type: None }}, object_list: {"pin": ObjectInfo { class_name: "PikaPiZero_RGB", name: "pin", import_class_name: "STM32_GPIO" }}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_ADC": ClassInfo { this_class_name: "PikaStdDevice_ADC", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_ADC", name: "enable", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_ADC", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_ADC", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "PikaStdDevice_ADC", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: Some(PyType { type_name: "float" }) }, "read": MethodInfo { class_name: "PikaStdDevice_ADC", name: "read", arg_list: None, return_type: Some(PyType { type_name: "float" }) }, "setPin": MethodInfo { class_name: "PikaStdDevice_ADC", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_GPIO": ClassInfo { this_class_name: "PikaStdDevice_GPIO", super_class_name: "TinyObj", method_list: {"disable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "disable", arg_list: None, return_type: None }, "enable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "enable", arg_list: None, return_type: None }, "getMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "getMode", arg_list: None, return_type: Some(PyType { type_name: "str" }) }, "getPin": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "getPin", arg_list: None, return_type: Some(PyType { type_name: "str" }) }, "high": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "high", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "init", arg_list: None, return_type: None }, "low": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "low", arg_list: None, return_type: None }, "platformDisable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformDisable", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformEnable", arg_list: None, return_type: None }, "platformHigh": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformHigh", arg_list: None, return_type: None }, "platformLow": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformLow", arg_list: None, return_type: None }, "platformSetMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformSetMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }, "setMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "setMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }, "setPin": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pinName:str", list: {"pinName": PyArg { py_type: PyType { type_name: "str" }, name: "pinName" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_PWM": ClassInfo { this_class_name: "PikaStdDevice_PWM", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_PWM", name: "enable", arg_list: None, return_type: None }, "getDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "getDuty", arg_list: None, return_type: Some(PyType { type_name: "float" }) }, "getFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "getFrequency", arg_list: None, return_type: Some(PyType { type_name: "int" }) }, "init": MethodInfo { class_name: "PikaStdDevice_PWM", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformSetDuty", arg_list: Some(ArgList { py_arg_list: "pin:str,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformSetFrequency", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "setDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setDuty", arg_list: Some(ArgList { py_arg_list: "duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }} }), return_type: None }, "setFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setFrequency", arg_list: Some(ArgList { py_arg_list: "freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }} }), return_type: None }, "setPin": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_Time": ClassInfo { this_class_name: "PikaStdDevice_Time", super_class_name: "TinyObj", method_list: {"sleep_ms": MethodInfo { class_name: "PikaStdDevice_Time", name: "sleep_ms", arg_list: Some(ArgList { py_arg_list: "ms:int", list: {"ms": PyArg { py_type: PyType { type_name: "int" }, name: "ms" }} }), return_type: None }, "sleep_s": MethodInfo { class_name: "PikaStdDevice_Time", name: "sleep_s", arg_list: Some(ArgList { py_arg_list: "s:int", list: {"s": PyArg { py_type: PyType { type_name: "int" }, name: "s" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_UART": ClassInfo { this_class_name: "PikaStdDevice_UART", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_UART", name: "enable", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_UART", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "id:int,baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "id:int,length:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }, "length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "platformWrite": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformWrite", arg_list: Some(ArgList { py_arg_list: "id:int,data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "read": MethodInfo { class_name: "PikaStdDevice_UART", name: "read", arg_list: Some(ArgList { py_arg_list: "length:int", list: {"length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "setBaudRate": MethodInfo { class_name: "PikaStdDevice_UART", name: "setBaudRate", arg_list: Some(ArgList { py_arg_list: "baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }} }), return_type: None }, "setId": MethodInfo { class_name: "PikaStdDevice_UART", name: "setId", arg_list: Some(ArgList { py_arg_list: "id:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "write": MethodInfo { class_name: "PikaStdDevice_UART", name: "write", arg_list: Some(ArgList { py_arg_list: "data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdLib_MemChecker": ClassInfo { this_class_name: "PikaStdLib_MemChecker", super_class_name: "BaseObj", method_list: {"max": MethodInfo { class_name: "PikaStdLib_MemChecker", name: "max", arg_list: None, return_type: None }, "now": MethodInfo { class_name: "PikaStdLib_MemChecker", name: "now", arg_list: None, return_type: None }, "resetMax": MethodInfo { class_name: "PikaStdLib_MemChecker", name: "resetMax", arg_list: None, return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdLib_SysObj": ClassInfo { this_class_name: "PikaStdLib_SysObj", super_class_name: "BaseObj", method_list: {"ls": MethodInfo { class_name: "PikaStdLib_SysObj", name: "ls", arg_list: Some(ArgList { py_arg_list: "objPath:str", list: {"objPath": PyArg { py_type: PyType { type_name: "str" }, name: "objPath" }} }), return_type: None }, "new": MethodInfo { class_name: "PikaStdLib_SysObj", name: "new", arg_list: Some(ArgList { py_arg_list: "objPath:str,classPath:str", list: {"classPath": PyArg { py_type: PyType { type_name: "str" }, name: "classPath" }, "objPath": PyArg { py_type: PyType { type_name: "str" }, name: "objPath" }} }), return_type: None }, "remove": MethodInfo { class_name: "PikaStdLib_SysObj", name: "remove", arg_list: Some(ArgList { py_arg_list: "argPath:str", list: {"argPath": PyArg { py_type: PyType { type_name: "str" }, name: "argPath" }} }), return_type: None }, "type": MethodInfo { class_name: "PikaStdLib_SysObj", name: "type", arg_list: Some(ArgList { py_arg_list: "argPath:str", list: {"argPath": PyArg { py_type: PyType { type_name: "str" }, name: "argPath" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_ADC": ClassInfo { this_class_name: "STM32_ADC", super_class_name: "PikaStdDevice_ADC", method_list: {"platformEnable": MethodInfo { class_name: "STM32_ADC", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "STM32_ADC", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: Some(PyType { type_name: "float" }) }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_GPIO": ClassInfo { this_class_name: "STM32_GPIO", super_class_name: "PikaStdDevice_GPIO", method_list: {"platformDisable": MethodInfo { class_name: "STM32_GPIO", name: "platformDisable", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "STM32_GPIO", name: "platformEnable", arg_list: None, return_type: None }, "platformHigh": MethodInfo { class_name: "STM32_GPIO", name: "platformHigh", arg_list: None, return_type: None }, "platformLow": MethodInfo { class_name: "STM32_GPIO", name: "platformLow", arg_list: None, return_type: None }, "platformSetMode": MethodInfo { class_name: "STM32_GPIO", name: "platformSetMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_PWM": ClassInfo { this_class_name: "STM32_PWM", super_class_name: "PikaStdDevice_PWM", method_list: {"platformEnable": MethodInfo { class_name: "STM32_PWM", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetDuty": MethodInfo { class_name: "STM32_PWM", name: "platformSetDuty", arg_list: Some(ArgList { py_arg_list: "pin:str,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetFrequency": MethodInfo { class_name: "STM32_PWM", name: "platformSetFrequency", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_Time": ClassInfo { this_class_name: "STM32_Time", super_class_name: "PikaStdDevice_Time", method_list: {"sleep_ms": MethodInfo { class_name: "STM32_Time", name: "sleep_ms", arg_list: Some(ArgList { py_arg_list: "ms:int", list: {"ms": PyArg { py_type: PyType { type_name: "int" }, name: "ms" }} }), return_type: None }, "sleep_s": MethodInfo { class_name: "STM32_Time", name: "sleep_s", arg_list: Some(ArgList { py_arg_list: "s:int", list: {"s": PyArg { py_type: PyType { type_name: "int" }, name: "s" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_UART": ClassInfo { this_class_name: "STM32_UART", super_class_name: "PikaStdDevice_UART", method_list: {"platformEnable": MethodInfo { class_name: "STM32_UART", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "id:int,baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "STM32_UART", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "id:int,length:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }, "length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "platformWrite": MethodInfo { class_name: "STM32_UART", name: "platformWrite", arg_list: Some(ArgList { py_arg_list: "id:int,data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }}, class_now_name: Some("PikaMain") } \ No newline at end of file +Compiler { dist_path: "pikascript-api/", source_path: "", class_list: {"PikaMain": ClassInfo { this_class_name: "PikaMain", super_class_name: "PikaStdLib_SysObj", method_list: {}, object_list: {"mem": ObjectInfo { class_name: "PikaMain", name: "mem", import_class_name: "PikaStdLib_MemChecker" }, "rgb": ObjectInfo { class_name: "PikaMain", name: "rgb", import_class_name: "PikaPiZero_RGB" }, "time": ObjectInfo { class_name: "PikaMain", name: "time", import_class_name: "STM32_Time" }, "uart": ObjectInfo { class_name: "PikaMain", name: "uart", import_class_name: "STM32_UART" }}, import_list: {}, script_list: Script { content: " obj_run(pikaMain, \"uart.init()\");\r\n obj_run(pikaMain, \"uart.setId(1)\");\r\n obj_run(pikaMain, \"uart.enable()\");\r\n obj_run(pikaMain, \"print('initing rgb...')\");\r\n obj_run(pikaMain, \"rgb.init()\");\r\n obj_run(pikaMain, \"rgb.enable()\");\r\n obj_run(pikaMain, \"print('init rgb ok!')\");\r\n obj_run(pikaMain, \"print('mem max:')\");\r\n obj_run(pikaMain, \"mem.max()\");\r\n obj_run(pikaMain, \"while True:\");\r\n obj_run(pikaMain, \" time.sleep_ms(50)\");\r\n obj_run(pikaMain, \" rgb.flow()\");\r\n" } }, "PikaPiZero_RGB": ClassInfo { this_class_name: "PikaPiZero_RGB", super_class_name: "PikaStdLib_SysObj", method_list: {"blue": MethodInfo { class_name: "PikaPiZero_RGB", name: "blue", arg_list: None, return_type: None }, "enable": MethodInfo { class_name: "PikaPiZero_RGB", name: "enable", arg_list: None, return_type: None }, "flow": MethodInfo { class_name: "PikaPiZero_RGB", name: "flow", arg_list: None, return_type: None }, "green": MethodInfo { class_name: "PikaPiZero_RGB", name: "green", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaPiZero_RGB", name: "init", arg_list: None, return_type: None }, "red": MethodInfo { class_name: "PikaPiZero_RGB", name: "red", arg_list: None, return_type: None }, "white": MethodInfo { class_name: "PikaPiZero_RGB", name: "white", arg_list: None, return_type: None }}, object_list: {"pin": ObjectInfo { class_name: "PikaPiZero_RGB", name: "pin", import_class_name: "STM32_GPIO" }}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_ADC": ClassInfo { this_class_name: "PikaStdDevice_ADC", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_ADC", name: "enable", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_ADC", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_ADC", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "PikaStdDevice_ADC", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: Some(PyType { type_name: "float" }) }, "read": MethodInfo { class_name: "PikaStdDevice_ADC", name: "read", arg_list: None, return_type: Some(PyType { type_name: "float" }) }, "setPin": MethodInfo { class_name: "PikaStdDevice_ADC", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_GPIO": ClassInfo { this_class_name: "PikaStdDevice_GPIO", super_class_name: "TinyObj", method_list: {"disable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "disable", arg_list: None, return_type: None }, "enable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "enable", arg_list: None, return_type: None }, "getMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "getMode", arg_list: None, return_type: Some(PyType { type_name: "str" }) }, "getPin": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "getPin", arg_list: None, return_type: Some(PyType { type_name: "str" }) }, "high": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "high", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "init", arg_list: None, return_type: None }, "low": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "low", arg_list: None, return_type: None }, "platformDisable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformDisable", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformEnable", arg_list: None, return_type: None }, "platformHigh": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformHigh", arg_list: None, return_type: None }, "platformLow": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformLow", arg_list: None, return_type: None }, "platformSetMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "platformSetMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }, "setMode": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "setMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }, "setPin": MethodInfo { class_name: "PikaStdDevice_GPIO", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pinName:str", list: {"pinName": PyArg { py_type: PyType { type_name: "str" }, name: "pinName" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_PWM": ClassInfo { this_class_name: "PikaStdDevice_PWM", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_PWM", name: "enable", arg_list: None, return_type: None }, "getDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "getDuty", arg_list: None, return_type: Some(PyType { type_name: "float" }) }, "getFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "getFrequency", arg_list: None, return_type: Some(PyType { type_name: "int" }) }, "init": MethodInfo { class_name: "PikaStdDevice_PWM", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformSetDuty", arg_list: Some(ArgList { py_arg_list: "pin:str,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "platformSetFrequency", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "setDuty": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setDuty", arg_list: Some(ArgList { py_arg_list: "duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }} }), return_type: None }, "setFrequency": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setFrequency", arg_list: Some(ArgList { py_arg_list: "freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }} }), return_type: None }, "setPin": MethodInfo { class_name: "PikaStdDevice_PWM", name: "setPin", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_Time": ClassInfo { this_class_name: "PikaStdDevice_Time", super_class_name: "TinyObj", method_list: {"sleep_ms": MethodInfo { class_name: "PikaStdDevice_Time", name: "sleep_ms", arg_list: Some(ArgList { py_arg_list: "ms:int", list: {"ms": PyArg { py_type: PyType { type_name: "int" }, name: "ms" }} }), return_type: None }, "sleep_s": MethodInfo { class_name: "PikaStdDevice_Time", name: "sleep_s", arg_list: Some(ArgList { py_arg_list: "s:int", list: {"s": PyArg { py_type: PyType { type_name: "int" }, name: "s" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdDevice_UART": ClassInfo { this_class_name: "PikaStdDevice_UART", super_class_name: "TinyObj", method_list: {"enable": MethodInfo { class_name: "PikaStdDevice_UART", name: "enable", arg_list: None, return_type: None }, "init": MethodInfo { class_name: "PikaStdDevice_UART", name: "init", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "id:int,baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "id:int,length:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }, "length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "platformWrite": MethodInfo { class_name: "PikaStdDevice_UART", name: "platformWrite", arg_list: Some(ArgList { py_arg_list: "id:int,data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "read": MethodInfo { class_name: "PikaStdDevice_UART", name: "read", arg_list: Some(ArgList { py_arg_list: "length:int", list: {"length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "setBaudRate": MethodInfo { class_name: "PikaStdDevice_UART", name: "setBaudRate", arg_list: Some(ArgList { py_arg_list: "baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }} }), return_type: None }, "setId": MethodInfo { class_name: "PikaStdDevice_UART", name: "setId", arg_list: Some(ArgList { py_arg_list: "id:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "write": MethodInfo { class_name: "PikaStdDevice_UART", name: "write", arg_list: Some(ArgList { py_arg_list: "data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdLib_MemChecker": ClassInfo { this_class_name: "PikaStdLib_MemChecker", super_class_name: "BaseObj", method_list: {"max": MethodInfo { class_name: "PikaStdLib_MemChecker", name: "max", arg_list: None, return_type: None }, "now": MethodInfo { class_name: "PikaStdLib_MemChecker", name: "now", arg_list: None, return_type: None }, "resetMax": MethodInfo { class_name: "PikaStdLib_MemChecker", name: "resetMax", arg_list: None, return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "PikaStdLib_SysObj": ClassInfo { this_class_name: "PikaStdLib_SysObj", super_class_name: "BaseObj", method_list: {"ls": MethodInfo { class_name: "PikaStdLib_SysObj", name: "ls", arg_list: Some(ArgList { py_arg_list: "objPath:str", list: {"objPath": PyArg { py_type: PyType { type_name: "str" }, name: "objPath" }} }), return_type: None }, "new": MethodInfo { class_name: "PikaStdLib_SysObj", name: "new", arg_list: Some(ArgList { py_arg_list: "objPath:str,classPath:str", list: {"classPath": PyArg { py_type: PyType { type_name: "str" }, name: "classPath" }, "objPath": PyArg { py_type: PyType { type_name: "str" }, name: "objPath" }} }), return_type: None }, "remove": MethodInfo { class_name: "PikaStdLib_SysObj", name: "remove", arg_list: Some(ArgList { py_arg_list: "argPath:str", list: {"argPath": PyArg { py_type: PyType { type_name: "str" }, name: "argPath" }} }), return_type: None }, "type": MethodInfo { class_name: "PikaStdLib_SysObj", name: "type", arg_list: Some(ArgList { py_arg_list: "argPath:str", list: {"argPath": PyArg { py_type: PyType { type_name: "str" }, name: "argPath" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_ADC": ClassInfo { this_class_name: "STM32_ADC", super_class_name: "PikaStdDevice_ADC", method_list: {"platformEnable": MethodInfo { class_name: "STM32_ADC", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "STM32_ADC", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "pin:str", list: {"pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: Some(PyType { type_name: "float" }) }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_GPIO": ClassInfo { this_class_name: "STM32_GPIO", super_class_name: "PikaStdDevice_GPIO", method_list: {"platformDisable": MethodInfo { class_name: "STM32_GPIO", name: "platformDisable", arg_list: None, return_type: None }, "platformEnable": MethodInfo { class_name: "STM32_GPIO", name: "platformEnable", arg_list: None, return_type: None }, "platformHigh": MethodInfo { class_name: "STM32_GPIO", name: "platformHigh", arg_list: None, return_type: None }, "platformLow": MethodInfo { class_name: "STM32_GPIO", name: "platformLow", arg_list: None, return_type: None }, "platformSetMode": MethodInfo { class_name: "STM32_GPIO", name: "platformSetMode", arg_list: Some(ArgList { py_arg_list: "mode:str", list: {"mode": PyArg { py_type: PyType { type_name: "str" }, name: "mode" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_PWM": ClassInfo { this_class_name: "STM32_PWM", super_class_name: "PikaStdDevice_PWM", method_list: {"platformEnable": MethodInfo { class_name: "STM32_PWM", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetDuty": MethodInfo { class_name: "STM32_PWM", name: "platformSetDuty", arg_list: Some(ArgList { py_arg_list: "pin:str,duty:float", list: {"duty": PyArg { py_type: PyType { type_name: "float" }, name: "duty" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }, "platformSetFrequency": MethodInfo { class_name: "STM32_PWM", name: "platformSetFrequency", arg_list: Some(ArgList { py_arg_list: "pin:str,freq:int", list: {"freq": PyArg { py_type: PyType { type_name: "int" }, name: "freq" }, "pin": PyArg { py_type: PyType { type_name: "str" }, name: "pin" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_Time": ClassInfo { this_class_name: "STM32_Time", super_class_name: "PikaStdDevice_Time", method_list: {"sleep_ms": MethodInfo { class_name: "STM32_Time", name: "sleep_ms", arg_list: Some(ArgList { py_arg_list: "ms:int", list: {"ms": PyArg { py_type: PyType { type_name: "int" }, name: "ms" }} }), return_type: None }, "sleep_s": MethodInfo { class_name: "STM32_Time", name: "sleep_s", arg_list: Some(ArgList { py_arg_list: "s:int", list: {"s": PyArg { py_type: PyType { type_name: "int" }, name: "s" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }, "STM32_UART": ClassInfo { this_class_name: "STM32_UART", super_class_name: "PikaStdDevice_UART", method_list: {"platformEnable": MethodInfo { class_name: "STM32_UART", name: "platformEnable", arg_list: Some(ArgList { py_arg_list: "id:int,baudRate:int", list: {"baudRate": PyArg { py_type: PyType { type_name: "int" }, name: "baudRate" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }, "platformRead": MethodInfo { class_name: "STM32_UART", name: "platformRead", arg_list: Some(ArgList { py_arg_list: "id:int,length:int", list: {"id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }, "length": PyArg { py_type: PyType { type_name: "int" }, name: "length" }} }), return_type: Some(PyType { type_name: "str" }) }, "platformWrite": MethodInfo { class_name: "STM32_UART", name: "platformWrite", arg_list: Some(ArgList { py_arg_list: "id:int,data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }, "id": PyArg { py_type: PyType { type_name: "int" }, name: "id" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" } }}, class_now_name: Some("PikaMain") } \ No newline at end of file diff --git a/demo/stm32g030c8/pikascript/pikascript-api/pikaScript.c b/demo/stm32g030c8/pikascript/pikascript-api/pikaScript.c index e6321e286..59c51e408 100644 --- a/demo/stm32g030c8/pikascript/pikascript-api/pikaScript.c +++ b/demo/stm32g030c8/pikascript/pikascript-api/pikaScript.c @@ -17,14 +17,8 @@ PikaObj * pikaScriptInit(){ obj_run(pikaMain, "print('mem max:')"); obj_run(pikaMain, "mem.max()"); obj_run(pikaMain, "while True:"); - obj_run(pikaMain, " time.sleep_ms(250)"); - obj_run(pikaMain, " rgb.red()"); - obj_run(pikaMain, " time.sleep_ms(250)"); - obj_run(pikaMain, " rgb.green()"); - obj_run(pikaMain, " time.sleep_ms(250)"); - obj_run(pikaMain, " rgb.white()"); - obj_run(pikaMain, " time.sleep_ms(250)"); - obj_run(pikaMain, " rgb.blue()"); + obj_run(pikaMain, " time.sleep_ms(50)"); + obj_run(pikaMain, " rgb.flow()"); obj_run(pikaMain, ""); return pikaMain; } diff --git a/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/PikaPiZero_RGB.c b/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/PikaPiZero_RGB.c index b477af5ae..11b0d1ed4 100644 --- a/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/PikaPiZero_RGB.c +++ b/demo/stm32g030c8/pikascript/pikascript-lib/PikaPiZero/PikaPiZero_RGB.c @@ -1,63 +1,93 @@ #include "PikaPiZero_RGB.h" -#include #include "BaseObj.h" +#include "RGB_ASM.h" #include "STM32_common.h" #include "dataStrs.h" -#include "RGB_ASM.h" +#include -void RGB_reset(){ - GPIOB->BRR = GPIO_PIN_12; // reset - delay_us(50); +void RGB_reset() { + GPIOB->BRR = GPIO_PIN_12; // reset + delay_us(50); } -#define RED 0x000F00 -#define GREEN 0x0F0000 -#define BLUE 0x00000F -#define WHITE 0x0F0F0F -#define CUTDOWN 0x000000 +#define RED 0x000100 +#define GREEN 0x010000 +#define BLUE 0x000001 +#define WHITE 0x010101 +#define CUTDOWN 0x000000 -void RGB_setVoid(){ - __asm( - "nop" - ); +void RGB_setVoid() { __asm("nop"); } + +void PikaPiZero_RGB_enable(PikaObj *self) { + obj_run(self, "pin.init()"); + obj_run(self, "pin.setPin('PB12')"); + obj_run(self, "pin.setMode('out')"); + obj_run(self, "pin.enable()"); +} +void PikaPiZero_RGB_init(PikaObj *self) {} + +void PikaPiZero_RGB_red(PikaObj *self) { + RGB_set(RED); + RGB_set(RED); + RGB_set(RED); + RGB_set(RED); } - - -void PikaPiZero_RGB_enable(PikaObj *self){ - obj_run(self, "pin.init()"); - obj_run(self, "pin.setPin('PB12')"); - obj_run(self, "pin.setMode('out')"); - obj_run(self, "pin.enable()"); -} -void PikaPiZero_RGB_init(PikaObj *self){ - +void PikaPiZero_RGB_blue(PikaObj *self) { + RGB_set(BLUE); + RGB_set(BLUE); + RGB_set(BLUE); + RGB_set(BLUE); } -void PikaPiZero_RGB_red(PikaObj *self){ - RGB_set(RED); +void PikaPiZero_RGB_green(PikaObj *self) { + RGB_set(GREEN); + RGB_set(GREEN); + RGB_set(GREEN); + RGB_set(GREEN); +} + +void PikaPiZero_RGB_white(PikaObj *self) { + RGB_set(WHITE); + RGB_set(WHITE); + RGB_set(WHITE); + RGB_set(WHITE); +} + +void PikaPiZero_RGB_flow(PikaObj *self) { + if (!obj_isArgExist(self, "flowState")) { + obj_setInt(self, "flowState", 0); + } + int flowState = obj_getInt(self, "flowState"); + if (0 == flowState) { RGB_set(RED); + RGB_set(BLUE); + RGB_set(GREEN); + RGB_set(WHITE); + goto exit; + } + if (1 == flowState) { + RGB_set(BLUE); + RGB_set(GREEN); + RGB_set(WHITE); RGB_set(RED); + goto exit; + } + if (2 == flowState) { + RGB_set(GREEN); + RGB_set(WHITE); RGB_set(RED); -} - -void PikaPiZero_RGB_blue(PikaObj *self){ - RGB_set(BLUE); RGB_set(BLUE); + goto exit; + } + if (3 == flowState) { + RGB_set(WHITE); + RGB_set(RED); RGB_set(BLUE); - RGB_set(BLUE); -} + RGB_set(GREEN); + goto exit; + } -void PikaPiZero_RGB_green(PikaObj *self){ - RGB_set(GREEN); - RGB_set(GREEN); - RGB_set(GREEN); - RGB_set(GREEN); -} - -void PikaPiZero_RGB_white(PikaObj *self){ - RGB_set(WHITE); - RGB_set(WHITE); - RGB_set(WHITE); - RGB_set(WHITE); +exit: + obj_setInt(self, "flowState", (flowState + 1) % 4); } \ No newline at end of file