formoduleinmodules:#for each module inside the list of modules
formoduleinmodules:#for each module inside the list of modules
ifmodule[0]notinmodule_index:#this if break is added to avoid the script from breaking at the start (which happens when serial is not yet receiving all values, but only fragments)
# print("break")
break# break and start the for loop again
function_index[module[0]](previous_module,module)#use function_index to run functions for each module
function_index[module[0]](previous_module,module)#use function_index to run functions for each module
previous_module=module_index[module[0]]#use module_index to replace abbr. with full name
previous_module=module_index[module[0]]#use module_index to replace abbr. with full name
ifmodule==modules[-1]:#if module is the last module in list of modules
ifmodule==modules[-1]:#if module is the last module in list of modules
final_module=module_index[module[0]]#use name of the last module to define final_module
final_module=module_index[module[0]]#use name of the last module to define final_module