






Started logging.

>>>
Content-Length: 3215

{"jsonrpc":"2.0","id":"1","method":"initialize","params":{"processId":4864,"clientInfo":{"name":"vscode","version":"1.53.2"},"rootPath":"C:\\Users\\Administrator\\AppData\\Local\\Temp\\arduino-language-server3557012346\\sketch","rootUri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch","initializationOptions":{},"capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"workspaceFolders":true,"configuration":true},"textDocument":{"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]},"contextSupport":true},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}},"contextSupport":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true},"codeAction":{"dynamicRegistration":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"isPreferredSupport":true},"codeLens":{"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"colorProvider":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"publishDiagnostics":{"relatedInformation":true,"tagSupport":{"valueSet":[1,2]}},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"selectionRange":{"dynamicRegistration":true}},"window":{"workDoneProgress":true}},"trace":"off","workspaceFolders":[{"uri":"file:///e%3A/5-%E6%95%99%E7%A8%8B/1.tutorial/ZYC0072%E6%9C%BA%E6%A2%B0%E6%89%8B%E5%B0%8F%E8%BD%A6/ZYC0072/4.%20Tutorial_Arduino/4_Arduino%20Code/6_BlueTooth","name":"6_BlueTooth"}]}}
<<<
Content-Length: 1905

{"id":"1","jsonrpc":"2.0","result":{"capabilities":{"astProvider":true,"callHierarchyProvider":true,"clangdInlayHintsProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor","info"]},"compilationDatabase":{"automaticReload":true},"completionProvider":{"allCommitCharacters":[" ","\t","(",")","[","]","{","}","<",">",":",";",",","+","-","/","*","%","^","&","#","?",".","=","\"","'","|"],"resolveProvider":false,"triggerCharacters":[".","<",">",":","\"","/","*"]},"declarationProvider":true,"definitionProvider":true,"documentFormattingProvider":true,"documentHighlightProvider":true,"documentLinkProvider":{"resolveProvider":false},"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"\n","moreTriggerCharacter":[]},"documentRangeFormattingProvider":true,"documentSymbolProvider":true,"executeCommandProvider":{"commands":["clangd.applyFix","clangd.applyTweak"]},"hoverProvider":true,"implementationProvider":true,"memoryUsageProvider":true,"referencesProvider":true,"renameProvider":{"prepareProvider":true},"selectionRangeProvider":true,"semanticTokensProvider":{"full":{"delta":true},"legend":{"tokenModifiers":["declaration","deprecated","deduced","readonly","static","abstract","virtual","dependentName","defaultLibrary","usedAsMutableReference","functionScope","classScope","fileScope","globalScope"],"tokenTypes":["variable","variable","parameter","function","method","function","property","variable","class","interface","enum","enumMember","type","type","unknown","namespace","typeParameter","concept","type","macro","comment"]},"range":false},"signatureHelpProvider":{"triggerCharacters":["(",")","{","}","<",">",","]},"textDocumentSync":{"change":2,"openClose":true,"save":true},"typeDefinitionProvider":true,"typeHierarchyProvider":true,"workspaceSymbolProvider":true},"serverInfo":{"name":"clangd","version":"clangd version 14.0.0 windows x86_64-pc-windows-msvc"}}}
>>>
Content-Length: 52

{"jsonrpc":"2.0","method":"initialized","params":{}}Content-Length: 39086

{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp","languageId":"cpp","version":1,"text":"#include \u003cArduino.h\u003e\n#line 1 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\n#include \u003cMsTimer2.h\u003e\n#include    \u003cServo.h\u003e\n\n// PWM control pin\n#define PWM1_PIN            5\n#define PWM2_PIN            6\n// 74HCT595N chip pin\n#define SHCP_PIN            2                               // The displacement of the clock\n#define EN_PIN              7                               // Can make control\n#define DATA_PIN            8                               // Serial data\n#define STCP_PIN            4                               // Memory register clock                  \n// Ultrasonic control pin\nconst int Trig       =      12;\nconst int Echo       =      13;\n// Trace the control pin\n#define LEFT_LINE_TRACJING      A0\n#define CENTER_LINE_TRACJING    A1\n#define right_LINE_TRACJING     A2\n// Servo control pin\n#define CLAW_PIN            9\n#define ARM_PIN             10\n#define BASE_PIN            11\n\nconst int Forward       = 92;                               // Forward\nconst int Backward      = 163;                              // Backward\nconst int Turn_Left     = 149;                              // Left translation\nconst int Turn_Right    = 106;                              // Right translation\nconst int Top_Left      = 20;                               // Upper left mobile\nconst int Bottom_Left   = 129;                              // Lower left mobile\nconst int Top_Right     = 72;                               // Upper right mobile\nconst int Bottom_Right  = 34;                               // The lower right move\nconst int Stop          = 0;                                // Stop\nconst int Contrarotate  = 172;                              // Counterclockwise rotation\nconst int Clockwise     = 83;                               // Rotate clockwise\n\n\nbyte TX_package[5] = {0xA5, 0, 0, 0, 0x5A};                 // Packet header(0xA5) +  original data (n*byte) + inspection sum(1byte) + Package the tail(0x5A)\nbyte RX_package[10] = {0};\nint UT_distance = 0;\nint Serialcount = 0;\nint base_degrees = 90;\nint arm_degrees = 90;\nint claw_degrees = 90;\nboolean menory_action_flag;\nboolean Line_tracking_Function_flag = false;\nboolean Avoidance_Function_flag = false;\nboolean Following_Function_flag = false;\nboolean Jail_Function_flag = false;\nint Left_Tra_Value;\nint Center_Tra_Value;\nint Right_Tra_Value;\nint Black_Line = 500;\nint actions_count = 0;\nint auto_count;\nint claw_read_degress[20] = {0, 0, 0};\nint arm_read_degress[20] = {0, 0, 0};\nint base_read_degress[20] = {0, 0, 0};\n\ntypedef struct \n{\n    byte mode1;             // Bit0: free mode;Bit1: tracking mode;Bit2: Obstacle avoidance mode;Bit3: Follow mode;\n                            // Bit4: Dungeon Mode;Bit5: Save button;Bit6: Automatic button;Bit7: empty\n    byte mode2;             // Bit0: fluke;Bit1: closed claw;Bit2: clockwise rotation;Bit3: reverse;\n    char x_axis = 0;        // Store variables on the X axis\n    char y_axis = 0;        // Store the variables on the Y axis\n    byte C_speed = 127;     // Speed of storage cart\n    char x_Base = 0;        // Store the steering gear on the X axis\n    char y_Arm = 0;         // Store the steering gear on the Y-axis\n}rx_buffer;\n\nrx_buffer RX_buffer;\n\nServo clawservo;\nServo armservo;\nServo baseservo;\n\n#line 77 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Timer2Isr();\n#line 82 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid setup();\n#line 117 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid loop();\n#line 154 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Line_tracking_Function();\n#line 194 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Avoidance_Function();\n#line 293 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Following_Function();\n#line 326 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Jail_Function();\n#line 476 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid auto_doit();\n#line 608 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid free_mode();\n#line 730 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid read_degress();\n#line 748 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid auto_do();\n#line 880 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Motor(int Dir, int Speed);\n#line 891 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nfloat SR04(int Trig, int Echo);\n#line 903 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid TX_Information(byte dis, byte act);\n#line 914 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid RX_Information(void);\n#line 77 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Timer2Isr()\n{\n    sei();\n    UT_distance = SR04(Trig, Echo);\n}\nvoid setup()\n{\n    pinMode(SHCP_PIN, OUTPUT);\n    pinMode(EN_PIN, OUTPUT);\n    pinMode(DATA_PIN, OUTPUT);\n    pinMode(STCP_PIN, OUTPUT);\n    pinMode(PWM1_PIN, OUTPUT);\n    pinMode(PWM2_PIN, OUTPUT);\n\n    pinMode(Trig, OUTPUT);\n    pinMode(Echo, INPUT);\n\n    pinMode(LEFT_LINE_TRACJING, INPUT);\n    pinMode(CENTER_LINE_TRACJING, INPUT);\n    pinMode(right_LINE_TRACJING, INPUT);\n\n    clawservo.attach(CLAW_PIN);\n    armservo.attach(ARM_PIN);\n    baseservo.attach(BASE_PIN);\n    clawservo.write(claw_degrees);\n    delay(500);\n    armservo.write(arm_degrees);\n    delay(500);\n    baseservo.write(base_degrees);\n    delay(500);\n\n    Motor(Stop, 0);\n\n    Serial.begin(9600);\n\n    //5ms timed interrupt Settings use timer2    \n    MsTimer2::set(100, Timer2Isr);\n    MsTimer2::start();\n}\n\nvoid loop()\n{\n    TX_Information(UT_distance, auto_count);                    // Send ultrasonic data\n    RX_Information();                                           // Receiving Bluetooth data\n    switch (RX_buffer.mode1)\n    {\n        case 0x02:       //tracking mode\n            Motor(Stop, 0);\n            Line_tracking_Function();\n            delay(10);\n            break;\n        case 0x04:       //Obstacle avoidance mode\n            Motor(Stop, 0);\n            Avoidance_Function();\n            delay(10);\n            break;\n        case 0x08:       //Follow the pattern\n            Motor(Stop, 0);\n            Following_Function();\n            delay(10);\n            break;\n        case 0x10:       //Dungeon mode\n            Motor(Stop, 0);\n            Jail_Function();\n            delay(10);\n            break;\n        case 0x40:       //Automatic mode\n            Motor(Stop, 0);\n            auto_doit();\n            delay(10);\n            break;\n        default:\n            free_mode();\n            break;\n    }\n}\n\nvoid Line_tracking_Function()       // tracking mode\n{\n    Line_tracking_Function_flag = true;\n    while (Line_tracking_Function_flag)\n    {\n        Left_Tra_Value = analogRead(LEFT_LINE_TRACJING);\n        Center_Tra_Value = analogRead(CENTER_LINE_TRACJING);\n        Right_Tra_Value = analogRead(right_LINE_TRACJING);\n        if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Forward, 175);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Contrarotate, 165);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Contrarotate, 190);\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Clockwise, 190);\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Clockwise, 165);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Stop, 0);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n        {\n            Line_tracking_Function_flag = false;\n        }\n    }\n}\n\nvoid Avoidance_Function()           // Obstacle avoidance mode\n{\n    int i;\n    Avoidance_Function_flag = true;\n    while (Avoidance_Function_flag)\n    {\n        if (UT_distance \u003c= 25)\n        {\n            if (UT_distance \u003c= 15)\n            {\n                Motor(Stop, 0);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 2; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Backward, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 12; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Clockwise, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 4; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                Motor(Stop, 0);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 2; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Backward, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 6; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Contrarotate, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 12; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n            }\n        }\n        else\n        {\n            Motor(Forward, 180);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n        {\n            Avoidance_Function_flag = false;\n        }\n    }\n}\n\nvoid Following_Function()           // Follow the pattern\n{\n    Following_Function_flag = true;\n    while (Following_Function_flag)\n    {\n        if (UT_distance \u003c 15)\n        {\n            Motor(Backward, 200);\n        }\n        else if (15 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 20)\n        {\n            Motor(Stop, 0);\n        }\n        else if (20 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 25)\n        {\n            Motor(Forward, 180);\n        }\n        else if (25 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 50)\n        {\n            Motor(Forward, 220);\n        }\n        else\n        {\n            Motor(Stop, 0);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x10)\n        {\n            Following_Function_flag = false;\n        }\n    }\n}\n\nvoid Jail_Function()                // Dungeon mode\n{\n    int i;\n    Jail_Function_flag = true;\n    while (Jail_Function_flag)\n    {\n        Left_Tra_Value = analogRead(LEFT_LINE_TRACJING);\n        Center_Tra_Value = analogRead(CENTER_LINE_TRACJING);\n        Right_Tra_Value = analogRead(right_LINE_TRACJING);\n        if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Forward, 150);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Backward,150);\n            /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Backward,150);\n             /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Backward,150);\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Contrarotate,160);\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Backward,150);\n             /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Contrarotate,160);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else\n        {\n            Motor(Backward,150);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n        {\n            Jail_Function_flag = false;\n        }\n    }\n}\n\nvoid auto_doit()                      // Automatic mode\n{\n    if (0 != auto_count)\n    {\n        menory_action_flag = true;\n    }\n    actions_count = 0;\n    claw_degrees = clawservo.read();\n    arm_degrees = armservo.read();\n    base_degrees = baseservo.read();\n    while (menory_action_flag)\n    {\n        for (int i = (1); i \u003c= (auto_count); i = i + (1))\n        {\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n            {\n                while (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees + 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (claw_degrees \u003e claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees - 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n            {\n                while (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees + 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (arm_degrees \u003e arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees - 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (base_degrees \u003c base_read_degress[(int)(i - 1)])\n            {\n                while (base_degrees \u003c base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees + 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (base_degrees \u003e base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees - 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n        }\n    }\n}\n\nvoid free_mode()                    // free mode\n{\n    if(RX_buffer.x_axis \u003e= -30 \u0026\u0026 RX_buffer.x_axis \u003c= 30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Forward\n    {\n        Motor(Forward, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= -30 \u0026\u0026 RX_buffer.x_axis \u003c= 30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Backward\n    {\n        Motor(Backward, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_axis \u003e= -30 \u0026\u0026 RX_buffer.y_axis \u003c= 30 \u0026\u0026 RX_buffer.x_axis \u003c= -30)     //Turn_Left\n    {\n        Motor(Turn_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_axis \u003e= -30 \u0026\u0026 RX_buffer.y_axis \u003c= 30 \u0026\u0026 RX_buffer.x_axis \u003e= 30)     //Turn_Right\n    {\n        Motor(Turn_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003c= -30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Top_Left\n    {\n        Motor(Top_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003c= -30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Bottom_Left\n    {\n        Motor(Bottom_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= 30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Top_Right\n    {\n        Motor(Top_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= 30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Bottom_Right\n    {\n        Motor(Bottom_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x04)     //Contrarotate\n    {\n        Motor(Contrarotate, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x08)     //Clockwise\n    {\n        Motor(Clockwise, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_Arm \u003c= 30 \u0026\u0026 RX_buffer.y_Arm \u003e= -30 \u0026\u0026 RX_buffer.x_Base \u003c= -30)    // base_left\n    {\n        base_degrees = base_degrees + 1;\n        if (base_degrees \u003e= 185) \n        {\n            base_degrees = 185;\n        }\n        baseservo.write(base_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.y_Arm \u003c= 30 \u0026\u0026 RX_buffer.y_Arm \u003e= -30 \u0026\u0026 RX_buffer.x_Base \u003e= 30)     // base_right\n    {\n        base_degrees = base_degrees - 1;\n        if (base_degrees \u003c= 0) \n        {\n            base_degrees = 0;\n        }\n        baseservo.write(base_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.x_Base \u003c= 30 \u0026\u0026 RX_buffer.x_Base \u003e= -30 \u0026\u0026 RX_buffer.y_Arm \u003c= -30)    // Arm contraction\n    {\n        arm_degrees = arm_degrees - 1;\n        if (arm_degrees \u003c= 0) \n        {\n            arm_degrees = 0;\n        }\n        armservo.write(arm_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.x_Base \u003c= 30 \u0026\u0026 RX_buffer.x_Base \u003e= -30 \u0026\u0026 RX_buffer.y_Arm \u003e= 30)     // Arm elongation\n    {\n        arm_degrees = arm_degrees + 1;\n        if (arm_degrees \u003e= 150) \n        {\n            arm_degrees = 150;\n        }\n        armservo.write(arm_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x01)            // claws open                                        \n    {\n        claw_degrees = claw_degrees - 1;\n        if (claw_degrees \u003c= 50) \n        {\n            claw_degrees = 50;\n        }\n        clawservo.write(claw_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x02)            // claws closed\n    {\n        claw_degrees = claw_degrees + 1;\n        if (claw_degrees \u003e= 150) \n        {\n            claw_degrees = 150;\n        }\n        clawservo.write(claw_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode1 \u0026 0x20)            // save\n    {\n        read_degress();\n    }  \n    else\n    {\n        Motor(Stop, 0);\n    }\n}\n\nvoid read_degress()\n{\n    if (actions_count \u003c= 19)\n    {\n        claw_read_degress[(int)((actions_count + 1) - 1)] = clawservo.read();\n        delay(50);\n        RX_Information(); \n        arm_read_degress[(int)((actions_count + 1) - 1)] = armservo.read();\n        delay(50);\n        RX_Information(); \n        base_read_degress[(int)((actions_count + 1) - 1)] = baseservo.read();\n        delay(50);\n        RX_Information(); \n        actions_count = actions_count + 1;\n        auto_count = actions_count;\n    }\n}\n\nvoid auto_do()\n{\n    if (0 != auto_count)\n    {\n        menory_action_flag = true;\n    }\n    actions_count = 0;\n    claw_degrees = clawservo.read();\n    arm_degrees = armservo.read();\n    base_degrees = baseservo.read();\n    while (menory_action_flag)\n    {\n        for (int i = (1); i \u003c= (auto_count); i = i + (1))\n        {\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n            {\n                while (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees + 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (claw_degrees \u003e claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees - 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n            {\n                while (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees + 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (arm_degrees \u003e arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees - 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (base_degrees \u003c base_read_degress[(int)(i - 1)])\n            {\n                while (base_degrees \u003c base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees + 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (base_degrees \u003e base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees - 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n        }\n    }\n}\n\nvoid Motor(int Dir, int Speed)      // Motor drive\n{\n    digitalWrite(EN_PIN, LOW);\n    analogWrite(PWM1_PIN, Speed);\n    analogWrite(PWM2_PIN, Speed);\n\n    digitalWrite(STCP_PIN, LOW);\n    shiftOut(DATA_PIN, SHCP_PIN, MSBFIRST, Dir);\n    digitalWrite(STCP_PIN, HIGH);\n}\n\nfloat SR04(int Trig, int Echo)      // Ultrasonic distance measurement\n{\n    digitalWrite(Trig, LOW);\n    delayMicroseconds(2);\n    digitalWrite(Trig, HIGH);\n    delayMicroseconds(10);\n    digitalWrite(Trig, LOW);\n    float distance = pulseIn(Echo, HIGH) / 58.00;\n    delay(10);\n    return distance;\n}\n\nvoid TX_Information(byte dis, byte act)     // Sending data packets\n{\n    int check;\n    if(dis\u003e127) dis = 127;\n    if(act\u003e127) act = 127;\n    TX_package[1] = dis;\n    TX_package[2] = act;\n    TX_package[3] = byte(dis + act);                        // The sum of inspection                              \n    Serial.write(TX_package, 5);                            // Sending data packets\n}\n\nvoid RX_Information(void)                   // Receiving data packet\n{\n    if(Serial.available() \u003e 0)\n    {\n        delay(1);                                           // delay 1MS\n        if(Serial.readBytes(RX_package, 10))\n        {\n            if (RX_package[0] == 0xA5 \u0026\u0026 RX_package[9] == 0x5A)     // The header and tail of the packet are verified\n            {\n                Serialcount = 0;\n                RX_buffer.mode1 = RX_package[1];\n                RX_buffer.mode2 = RX_package[2];\n                RX_buffer.x_axis = RX_package[3];\n                RX_buffer.y_axis = RX_package[4];\n                RX_buffer.C_speed = RX_package[5] + 127;\n                RX_buffer.x_Base = RX_package[6];\n                RX_buffer.y_Arm = RX_package[7];\n            }\n            else\n            {\n                Serialcount++;\n                return;\n            }\n        }\n    }\n    else\n    {\n        delay(1);\n        Serialcount++;\n        if(Serialcount \u003e 500)\n        {\n            Serialcount = 0;\n            RX_buffer.mode1 = 0; \n            RX_buffer.mode2 = 0;\n            RX_buffer.x_axis = 0;\n            RX_buffer.y_axis = 0;\n            RX_buffer.x_Base = 0;\n            RX_buffer.y_Arm = 0;\n            Line_tracking_Function_flag = false;\n            Avoidance_Function_flag = false;\n            Following_Function_flag = false;\n            Jail_Function_flag = false;\n        }\n    }\n}\n"}}}Content-Length: 311

{"jsonrpc":"2.0","id":"2","method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"range":{"start":{"line":2,"character":0},"end":{"line":2,"character":0}},"context":{"diagnostics":[]}}}
<<<
Content-Length: 188

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/.clangd"}}Content-Length: 111

{"id":0,"jsonrpc":"2.0","method":"window/workDoneProgress/create","params":{"token":"backgroundIndexProgress"}}
>>>
Content-Length: 38

{"jsonrpc":"2.0","id":0,"result":null}
<<<
Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"begin","percentage":0,"title":"indexing"}}}Content-Length: 141

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/1","percentage":0}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/27","percentage":0}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/27","percentage":0}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/27","percentage":0}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/27","percentage":0}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"1/27","percentage":3}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"1/27","percentage":3}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"1/27","percentage":3}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"1/27","percentage":3}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"2/27","percentage":7}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"2/27","percentage":7}}}Content-Length: 219

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp","version":1}}Content-Length: 38

{"id":"2","jsonrpc":"2.0","result":[]}
>>>
Content-Length: 212

{"jsonrpc":"2.0","id":"3","method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"}}}
<<<
Content-Length: 16685

{"id":"3","jsonrpc":"2.0","result":[{"detail":"const int","kind":13,"name":"Trig","range":{"end":{"character":30,"line":14},"start":{"character":0,"line":14}},"selectionRange":{"end":{"character":14,"line":14},"start":{"character":10,"line":14}}},{"detail":"const int","kind":13,"name":"Echo","range":{"end":{"character":30,"line":15},"start":{"character":0,"line":15}},"selectionRange":{"end":{"character":14,"line":15},"start":{"character":10,"line":15}}},{"detail":"const int","kind":13,"name":"Forward","range":{"end":{"character":28,"line":25},"start":{"character":0,"line":25}},"selectionRange":{"end":{"character":17,"line":25},"start":{"character":10,"line":25}}},{"detail":"const int","kind":13,"name":"Backward","range":{"end":{"character":29,"line":26},"start":{"character":0,"line":26}},"selectionRange":{"end":{"character":18,"line":26},"start":{"character":10,"line":26}}},{"detail":"const int","kind":13,"name":"Turn_Left","range":{"end":{"character":29,"line":27},"start":{"character":0,"line":27}},"selectionRange":{"end":{"character":19,"line":27},"start":{"character":10,"line":27}}},{"detail":"const int","kind":13,"name":"Turn_Right","range":{"end":{"character":29,"line":28},"start":{"character":0,"line":28}},"selectionRange":{"end":{"character":20,"line":28},"start":{"character":10,"line":28}}},{"detail":"const int","kind":13,"name":"Top_Left","range":{"end":{"character":28,"line":29},"start":{"character":0,"line":29}},"selectionRange":{"end":{"character":18,"line":29},"start":{"character":10,"line":29}}},{"detail":"const int","kind":13,"name":"Bottom_Left","range":{"end":{"character":29,"line":30},"start":{"character":0,"line":30}},"selectionRange":{"end":{"character":21,"line":30},"start":{"character":10,"line":30}}},{"detail":"const int","kind":13,"name":"Top_Right","range":{"end":{"character":28,"line":31},"start":{"character":0,"line":31}},"selectionRange":{"end":{"character":19,"line":31},"start":{"character":10,"line":31}}},{"detail":"const int","kind":13,"name":"Bottom_Right","range":{"end":{"character":28,"line":32},"start":{"character":0,"line":32}},"selectionRange":{"end":{"character":22,"line":32},"start":{"character":10,"line":32}}},{"detail":"const int","kind":13,"name":"Stop","range":{"end":{"character":27,"line":33},"start":{"character":0,"line":33}},"selectionRange":{"end":{"character":14,"line":33},"start":{"character":10,"line":33}}},{"detail":"const int","kind":13,"name":"Contrarotate","range":{"end":{"character":29,"line":34},"start":{"character":0,"line":34}},"selectionRange":{"end":{"character":22,"line":34},"start":{"character":10,"line":34}}},{"detail":"const int","kind":13,"name":"Clockwise","range":{"end":{"character":28,"line":35},"start":{"character":0,"line":35}},"selectionRange":{"end":{"character":19,"line":35},"start":{"character":10,"line":35}}},{"detail":"byte[5]","kind":13,"name":"TX_package","range":{"end":{"character":42,"line":38},"start":{"character":0,"line":38}},"selectionRange":{"end":{"character":15,"line":38},"start":{"character":5,"line":38}}},{"detail":"byte[10]","kind":13,"name":"RX_package","range":{"end":{"character":25,"line":39},"start":{"character":0,"line":39}},"selectionRange":{"end":{"character":15,"line":39},"start":{"character":5,"line":39}}},{"detail":"int","kind":13,"name":"UT_distance","range":{"end":{"character":19,"line":40},"start":{"character":0,"line":40}},"selectionRange":{"end":{"character":15,"line":40},"start":{"character":4,"line":40}}},{"detail":"int","kind":13,"name":"Serialcount","range":{"end":{"character":19,"line":41},"start":{"character":0,"line":41}},"selectionRange":{"end":{"character":15,"line":41},"start":{"character":4,"line":41}}},{"detail":"int","kind":13,"name":"base_degrees","range":{"end":{"character":21,"line":42},"start":{"character":0,"line":42}},"selectionRange":{"end":{"character":16,"line":42},"start":{"character":4,"line":42}}},{"detail":"int","kind":13,"name":"arm_degrees","range":{"end":{"character":20,"line":43},"start":{"character":0,"line":43}},"selectionRange":{"end":{"character":15,"line":43},"start":{"character":4,"line":43}}},{"detail":"int","kind":13,"name":"claw_degrees","range":{"end":{"character":21,"line":44},"start":{"character":0,"line":44}},"selectionRange":{"end":{"character":16,"line":44},"start":{"character":4,"line":44}}},{"detail":"boolean","kind":13,"name":"menory_action_flag","range":{"end":{"character":26,"line":45},"start":{"character":0,"line":45}},"selectionRange":{"end":{"character":26,"line":45},"start":{"character":8,"line":45}}},{"detail":"boolean","kind":13,"name":"Line_tracking_Function_flag","range":{"end":{"character":43,"line":46},"start":{"character":0,"line":46}},"selectionRange":{"end":{"character":35,"line":46},"start":{"character":8,"line":46}}},{"detail":"boolean","kind":13,"name":"Avoidance_Function_flag","range":{"end":{"character":39,"line":47},"start":{"character":0,"line":47}},"selectionRange":{"end":{"character":31,"line":47},"start":{"character":8,"line":47}}},{"detail":"boolean","kind":13,"name":"Following_Function_flag","range":{"end":{"character":39,"line":48},"start":{"character":0,"line":48}},"selectionRange":{"end":{"character":31,"line":48},"start":{"character":8,"line":48}}},{"detail":"boolean","kind":13,"name":"Jail_Function_flag","range":{"end":{"character":34,"line":49},"start":{"character":0,"line":49}},"selectionRange":{"end":{"character":26,"line":49},"start":{"character":8,"line":49}}},{"detail":"int","kind":13,"name":"Left_Tra_Value","range":{"end":{"character":18,"line":50},"start":{"character":0,"line":50}},"selectionRange":{"end":{"character":18,"line":50},"start":{"character":4,"line":50}}},{"detail":"int","kind":13,"name":"Center_Tra_Value","range":{"end":{"character":20,"line":51},"start":{"character":0,"line":51}},"selectionRange":{"end":{"character":20,"line":51},"start":{"character":4,"line":51}}},{"detail":"int","kind":13,"name":"Right_Tra_Value","range":{"end":{"character":19,"line":52},"start":{"character":0,"line":52}},"selectionRange":{"end":{"character":19,"line":52},"start":{"character":4,"line":52}}},{"detail":"int","kind":13,"name":"Black_Line","range":{"end":{"character":20,"line":53},"start":{"character":0,"line":53}},"selectionRange":{"end":{"character":14,"line":53},"start":{"character":4,"line":53}}},{"detail":"int","kind":13,"name":"actions_count","range":{"end":{"character":21,"line":54},"start":{"character":0,"line":54}},"selectionRange":{"end":{"character":17,"line":54},"start":{"character":4,"line":54}}},{"detail":"int","kind":13,"name":"auto_count","range":{"end":{"character":14,"line":55},"start":{"character":0,"line":55}},"selectionRange":{"end":{"character":14,"line":55},"start":{"character":4,"line":55}}},{"detail":"int[20]","kind":13,"name":"claw_read_degress","range":{"end":{"character":37,"line":56},"start":{"character":0,"line":56}},"selectionRange":{"end":{"character":21,"line":56},"start":{"character":4,"line":56}}},{"detail":"int[20]","kind":13,"name":"arm_read_degress","range":{"end":{"character":36,"line":57},"start":{"character":0,"line":57}},"selectionRange":{"end":{"character":20,"line":57},"start":{"character":4,"line":57}}},{"detail":"int[20]","kind":13,"name":"base_read_degress","range":{"end":{"character":37,"line":58},"start":{"character":0,"line":58}},"selectionRange":{"end":{"character":21,"line":58},"start":{"character":4,"line":58}}},{"children":[{"detail":"byte","kind":8,"name":"mode1","range":{"end":{"character":14,"line":62},"start":{"character":4,"line":62}},"selectionRange":{"end":{"character":14,"line":62},"start":{"character":9,"line":62}}},{"detail":"byte","kind":8,"name":"mode2","range":{"end":{"character":14,"line":64},"start":{"character":4,"line":64}},"selectionRange":{"end":{"character":14,"line":64},"start":{"character":9,"line":64}}},{"detail":"char","kind":8,"name":"x_axis","range":{"end":{"character":19,"line":65},"start":{"character":4,"line":65}},"selectionRange":{"end":{"character":15,"line":65},"start":{"character":9,"line":65}}},{"detail":"char","kind":8,"name":"y_axis","range":{"end":{"character":19,"line":66},"start":{"character":4,"line":66}},"selectionRange":{"end":{"character":15,"line":66},"start":{"character":9,"line":66}}},{"detail":"byte","kind":8,"name":"C_speed","range":{"end":{"character":22,"line":67},"start":{"character":4,"line":67}},"selectionRange":{"end":{"character":16,"line":67},"start":{"character":9,"line":67}}},{"detail":"char","kind":8,"name":"x_Base","range":{"end":{"character":19,"line":68},"start":{"character":4,"line":68}},"selectionRange":{"end":{"character":15,"line":68},"start":{"character":9,"line":68}}},{"detail":"char","kind":8,"name":"y_Arm","range":{"end":{"character":18,"line":69},"start":{"character":4,"line":69}},"selectionRange":{"end":{"character":14,"line":69},"start":{"character":9,"line":69}}}],"detail":"struct","kind":23,"name":"(anonymous struct)","range":{"end":{"character":1,"line":70},"start":{"character":8,"line":60}},"selectionRange":{"end":{"character":14,"line":60},"start":{"character":8,"line":60}}},{"detail":"type alias","kind":5,"name":"rx_buffer","range":{"end":{"character":10,"line":70},"start":{"character":0,"line":60}},"selectionRange":{"end":{"character":10,"line":70},"start":{"character":1,"line":70}}},{"detail":"rx_buffer","kind":13,"name":"RX_buffer","range":{"end":{"character":19,"line":72},"start":{"character":0,"line":72}},"selectionRange":{"end":{"character":19,"line":72},"start":{"character":10,"line":72}}},{"detail":"Servo","kind":13,"name":"clawservo","range":{"end":{"character":15,"line":74},"start":{"character":0,"line":74}},"selectionRange":{"end":{"character":15,"line":74},"start":{"character":6,"line":74}}},{"detail":"Servo","kind":13,"name":"armservo","range":{"end":{"character":14,"line":75},"start":{"character":0,"line":75}},"selectionRange":{"end":{"character":14,"line":75},"start":{"character":6,"line":75}}},{"detail":"Servo","kind":13,"name":"baseservo","range":{"end":{"character":15,"line":76},"start":{"character":0,"line":76}},"selectionRange":{"end":{"character":15,"line":76},"start":{"character":6,"line":76}}},{"detail":"void ()","kind":12,"name":"Timer2Isr","range":{"end":{"character":16,"line":79},"start":{"character":0,"line":79}},"selectionRange":{"end":{"character":14,"line":79},"start":{"character":5,"line":79}}},{"detail":"void ()","kind":12,"name":"setup","range":{"end":{"character":12,"line":81},"start":{"character":0,"line":81}},"selectionRange":{"end":{"character":10,"line":81},"start":{"character":5,"line":81}}},{"detail":"void ()","kind":12,"name":"loop","range":{"end":{"character":11,"line":83},"start":{"character":0,"line":83}},"selectionRange":{"end":{"character":9,"line":83},"start":{"character":5,"line":83}}},{"detail":"void ()","kind":12,"name":"Line_tracking_Function","range":{"end":{"character":29,"line":85},"start":{"character":0,"line":85}},"selectionRange":{"end":{"character":27,"line":85},"start":{"character":5,"line":85}}},{"detail":"void ()","kind":12,"name":"Avoidance_Function","range":{"end":{"character":25,"line":87},"start":{"character":0,"line":87}},"selectionRange":{"end":{"character":23,"line":87},"start":{"character":5,"line":87}}},{"detail":"void ()","kind":12,"name":"Following_Function","range":{"end":{"character":25,"line":89},"start":{"character":0,"line":89}},"selectionRange":{"end":{"character":23,"line":89},"start":{"character":5,"line":89}}},{"detail":"void ()","kind":12,"name":"Jail_Function","range":{"end":{"character":20,"line":91},"start":{"character":0,"line":91}},"selectionRange":{"end":{"character":18,"line":91},"start":{"character":5,"line":91}}},{"detail":"void ()","kind":12,"name":"auto_doit","range":{"end":{"character":16,"line":93},"start":{"character":0,"line":93}},"selectionRange":{"end":{"character":14,"line":93},"start":{"character":5,"line":93}}},{"detail":"void ()","kind":12,"name":"free_mode","range":{"end":{"character":16,"line":95},"start":{"character":0,"line":95}},"selectionRange":{"end":{"character":14,"line":95},"start":{"character":5,"line":95}}},{"detail":"void ()","kind":12,"name":"read_degress","range":{"end":{"character":19,"line":97},"start":{"character":0,"line":97}},"selectionRange":{"end":{"character":17,"line":97},"start":{"character":5,"line":97}}},{"detail":"void ()","kind":12,"name":"auto_do","range":{"end":{"character":14,"line":99},"start":{"character":0,"line":99}},"selectionRange":{"end":{"character":12,"line":99},"start":{"character":5,"line":99}}},{"detail":"void (int, int)","kind":12,"name":"Motor","range":{"end":{"character":30,"line":101},"start":{"character":0,"line":101}},"selectionRange":{"end":{"character":10,"line":101},"start":{"character":5,"line":101}}},{"detail":"float (int, int)","kind":12,"name":"SR04","range":{"end":{"character":30,"line":103},"start":{"character":0,"line":103}},"selectionRange":{"end":{"character":10,"line":103},"start":{"character":6,"line":103}}},{"detail":"void (byte, byte)","kind":12,"name":"TX_Information","range":{"end":{"character":39,"line":105},"start":{"character":0,"line":105}},"selectionRange":{"end":{"character":19,"line":105},"start":{"character":5,"line":105}}},{"detail":"void ()","kind":12,"name":"RX_Information","range":{"end":{"character":25,"line":107},"start":{"character":0,"line":107}},"selectionRange":{"end":{"character":19,"line":107},"start":{"character":5,"line":107}}},{"detail":"void ()","kind":12,"name":"Timer2Isr","range":{"end":{"character":1,"line":113},"start":{"character":0,"line":109}},"selectionRange":{"end":{"character":14,"line":109},"start":{"character":5,"line":109}}},{"detail":"void ()","kind":12,"name":"setup","range":{"end":{"character":1,"line":147},"start":{"character":0,"line":114}},"selectionRange":{"end":{"character":10,"line":114},"start":{"character":5,"line":114}}},{"detail":"void ()","kind":12,"name":"loop","range":{"end":{"character":1,"line":184},"start":{"character":0,"line":149}},"selectionRange":{"end":{"character":9,"line":149},"start":{"character":5,"line":149}}},{"detail":"void ()","kind":12,"name":"Line_tracking_Function","range":{"end":{"character":1,"line":224},"start":{"character":0,"line":186}},"selectionRange":{"end":{"character":27,"line":186},"start":{"character":5,"line":186}}},{"detail":"void ()","kind":12,"name":"Avoidance_Function","range":{"end":{"character":1,"line":323},"start":{"character":0,"line":226}},"selectionRange":{"end":{"character":23,"line":226},"start":{"character":5,"line":226}}},{"detail":"void ()","kind":12,"name":"Following_Function","range":{"end":{"character":1,"line":356},"start":{"character":0,"line":325}},"selectionRange":{"end":{"character":23,"line":325},"start":{"character":5,"line":325}}},{"detail":"void ()","kind":12,"name":"Jail_Function","range":{"end":{"character":1,"line":506},"start":{"character":0,"line":358}},"selectionRange":{"end":{"character":18,"line":358},"start":{"character":5,"line":358}}},{"detail":"void ()","kind":12,"name":"auto_doit","range":{"end":{"character":1,"line":638},"start":{"character":0,"line":508}},"selectionRange":{"end":{"character":14,"line":508},"start":{"character":5,"line":508}}},{"detail":"void ()","kind":12,"name":"free_mode","range":{"end":{"character":1,"line":760},"start":{"character":0,"line":640}},"selectionRange":{"end":{"character":14,"line":640},"start":{"character":5,"line":640}}},{"detail":"void ()","kind":12,"name":"read_degress","range":{"end":{"character":1,"line":778},"start":{"character":0,"line":762}},"selectionRange":{"end":{"character":17,"line":762},"start":{"character":5,"line":762}}},{"detail":"void ()","kind":12,"name":"auto_do","range":{"end":{"character":1,"line":910},"start":{"character":0,"line":780}},"selectionRange":{"end":{"character":12,"line":780},"start":{"character":5,"line":780}}},{"detail":"void (int, int)","kind":12,"name":"Motor","range":{"end":{"character":1,"line":921},"start":{"character":0,"line":912}},"selectionRange":{"end":{"character":10,"line":912},"start":{"character":5,"line":912}}},{"detail":"float (int, int)","kind":12,"name":"SR04","range":{"end":{"character":1,"line":933},"start":{"character":0,"line":923}},"selectionRange":{"end":{"character":10,"line":923},"start":{"character":6,"line":923}}},{"detail":"void (byte, byte)","kind":12,"name":"TX_Information","range":{"end":{"character":1,"line":944},"start":{"character":0,"line":935}},"selectionRange":{"end":{"character":19,"line":935},"start":{"character":5,"line":935}}},{"detail":"void ()","kind":12,"name":"RX_Information","range":{"end":{"character":1,"line":990},"start":{"character":0,"line":946}},"selectionRange":{"end":{"character":19,"line":946},"start":{"character":5,"line":946}}}]}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"3/27","percentage":11}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"3/27","percentage":11}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"4/27","percentage":14}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"4/27","percentage":14}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"5/27","percentage":18}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"5/27","percentage":18}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"6/27","percentage":22}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"6/27","percentage":22}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"7/27","percentage":25}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"7/27","percentage":25}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"8/27","percentage":29}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"8/27","percentage":29}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"9/27","percentage":33}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"9/27","percentage":33}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"10/27","percentage":37}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"10/27","percentage":37}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"11/27","percentage":40}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"11/27","percentage":40}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"12/27","percentage":44}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"12/27","percentage":44}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"13/27","percentage":48}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"13/27","percentage":48}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"14/27","percentage":51}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"14/27","percentage":51}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"15/27","percentage":55}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"15/27","percentage":55}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"16/27","percentage":59}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"16/27","percentage":59}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"17/27","percentage":62}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"17/27","percentage":62}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"18/27","percentage":66}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"18/27","percentage":66}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"19/27","percentage":70}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"19/27","percentage":70}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"20/27","percentage":74}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"20/27","percentage":74}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"21/27","percentage":77}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"21/27","percentage":77}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"22/27","percentage":81}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"23/27","percentage":85}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"24/27","percentage":88}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"25/27","percentage":92}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"26/27","percentage":96}}}Content-Length: 107

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"end"}}}
>>>
Content-Length: 196

{"jsonrpc":"2.0","method":"textDocument/didSave","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"}}}Content-Length: 39090

{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp","version":2},"contentChanges":[{"text":"#include \u003cArduino.h\u003e\n#line 1 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\n#include \u003cMsTimer2.h\u003e\n#include    \u003cServo.h\u003e\n\n// PWM control pin\n#define PWM1_PIN            5\n#define PWM2_PIN            6\n// 74HCT595N chip pin\n#define SHCP_PIN            2                               // The displacement of the clock\n#define EN_PIN              7                               // Can make control\n#define DATA_PIN            8                               // Serial data\n#define STCP_PIN            4                               // Memory register clock                  \n// Ultrasonic control pin\nconst int Trig       =      12;\nconst int Echo       =      13;\n// Trace the control pin\n#define LEFT_LINE_TRACJING      A0\n#define CENTER_LINE_TRACJING    A1\n#define right_LINE_TRACJING     A2\n// Servo control pin\n#define CLAW_PIN            9\n#define ARM_PIN             10\n#define BASE_PIN            11\n\nconst int Forward       = 92;                               // Forward\nconst int Backward      = 163;                              // Backward\nconst int Turn_Left     = 149;                              // Left translation\nconst int Turn_Right    = 106;                              // Right translation\nconst int Top_Left      = 20;                               // Upper left mobile\nconst int Bottom_Left   = 129;                              // Lower left mobile\nconst int Top_Right     = 72;                               // Upper right mobile\nconst int Bottom_Right  = 34;                               // The lower right move\nconst int Stop          = 0;                                // Stop\nconst int Contrarotate  = 172;                              // Counterclockwise rotation\nconst int Clockwise     = 83;                               // Rotate clockwise\n\n\nbyte TX_package[5] = {0xA5, 0, 0, 0, 0x5A};                 // Packet header(0xA5) +  original data (n*byte) + inspection sum(1byte) + Package the tail(0x5A)\nbyte RX_package[10] = {0};\nint UT_distance = 0;\nint Serialcount = 0;\nint base_degrees = 90;\nint arm_degrees = 90;\nint claw_degrees = 90;\nboolean menory_action_flag;\nboolean Line_tracking_Function_flag = false;\nboolean Avoidance_Function_flag = false;\nboolean Following_Function_flag = false;\nboolean Jail_Function_flag = false;\nint Left_Tra_Value;\nint Center_Tra_Value;\nint Right_Tra_Value;\nint Black_Line = 500;\nint actions_count = 0;\nint auto_count;\nint claw_read_degress[20] = {0, 0, 0};\nint arm_read_degress[20] = {0, 0, 0};\nint base_read_degress[20] = {0, 0, 0};\n\ntypedef struct \n{\n    byte mode1;             // Bit0: free mode;Bit1: tracking mode;Bit2: Obstacle avoidance mode;Bit3: Follow mode;\n                            // Bit4: Dungeon Mode;Bit5: Save button;Bit6: Automatic button;Bit7: empty\n    byte mode2;             // Bit0: fluke;Bit1: closed claw;Bit2: clockwise rotation;Bit3: reverse;\n    char x_axis = 0;        // Store variables on the X axis\n    char y_axis = 0;        // Store the variables on the Y axis\n    byte C_speed = 127;     // Speed of storage cart\n    char x_Base = 0;        // Store the steering gear on the X axis\n    char y_Arm = 0;         // Store the steering gear on the Y-axis\n}rx_buffer;\n\nrx_buffer RX_buffer;\n\nServo clawservo;\nServo armservo;\nServo baseservo;\n\n#line 77 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Timer2Isr();\n#line 82 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid setup();\n#line 117 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid loop();\n#line 154 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Line_tracking_Function();\n#line 194 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Avoidance_Function();\n#line 293 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Following_Function();\n#line 326 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Jail_Function();\n#line 476 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid auto_doit();\n#line 608 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid free_mode();\n#line 730 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid read_degress();\n#line 748 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid auto_do();\n#line 880 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Motor(int Dir, int Speed);\n#line 891 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nfloat SR04(int Trig, int Echo);\n#line 903 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid TX_Information(byte dis, byte act);\n#line 914 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid RX_Information(void);\n#line 77 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Timer2Isr()\n{\n    sei();\n    UT_distance = SR04(Trig, Echo);\n}\nvoid setup()\n{\n    pinMode(SHCP_PIN, OUTPUT);\n    pinMode(EN_PIN, OUTPUT);\n    pinMode(DATA_PIN, OUTPUT);\n    pinMode(STCP_PIN, OUTPUT);\n    pinMode(PWM1_PIN, OUTPUT);\n    pinMode(PWM2_PIN, OUTPUT);\n\n    pinMode(Trig, OUTPUT);\n    pinMode(Echo, INPUT);\n\n    pinMode(LEFT_LINE_TRACJING, INPUT);\n    pinMode(CENTER_LINE_TRACJING, INPUT);\n    pinMode(right_LINE_TRACJING, INPUT);\n\n    clawservo.attach(CLAW_PIN);\n    armservo.attach(ARM_PIN);\n    baseservo.attach(BASE_PIN);\n    clawservo.write(claw_degrees);\n    delay(500);\n    armservo.write(arm_degrees);\n    delay(500);\n    baseservo.write(base_degrees);\n    delay(500);\n\n    Motor(Stop, 0);\n\n    Serial.begin(9600);\n\n    //5ms timed interrupt Settings use timer2    \n    MsTimer2::set(100, Timer2Isr);\n    MsTimer2::start();\n}\n\nvoid loop()\n{\n    TX_Information(UT_distance, auto_count);                    // Send ultrasonic data\n    RX_Information();                                           // Receiving Bluetooth data\n    switch (RX_buffer.mode1)\n    {\n        case 0x02:       //tracking mode\n            Motor(Stop, 0);\n            Line_tracking_Function();\n            delay(10);\n            break;\n        case 0x04:       //Obstacle avoidance mode\n            Motor(Stop, 0);\n            Avoidance_Function();\n            delay(10);\n            break;\n        case 0x08:       //Follow the pattern\n            Motor(Stop, 0);\n            Following_Function();\n            delay(10);\n            break;\n        case 0x10:       //Dungeon mode\n            Motor(Stop, 0);\n            Jail_Function();\n            delay(10);\n            break;\n        case 0x40:       //Automatic mode\n            Motor(Stop, 0);\n            auto_doit();\n            delay(10);\n            break;\n        default:\n            free_mode();\n            break;\n    }\n}\n\nvoid Line_tracking_Function()       // tracking mode\n{\n    Line_tracking_Function_flag = true;\n    while (Line_tracking_Function_flag)\n    {\n        Left_Tra_Value = analogRead(LEFT_LINE_TRACJING);\n        Center_Tra_Value = analogRead(CENTER_LINE_TRACJING);\n        Right_Tra_Value = analogRead(right_LINE_TRACJING);\n        if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Forward, 175);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Contrarotate, 165);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Contrarotate, 190);\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Clockwise, 190);\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Clockwise, 165);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Stop, 0);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n        {\n            Line_tracking_Function_flag = false;\n        }\n    }\n}\n\nvoid Avoidance_Function()           // Obstacle avoidance mode\n{\n    int i;\n    Avoidance_Function_flag = true;\n    while (Avoidance_Function_flag)\n    {\n        if (UT_distance \u003c= 25)\n        {\n            if (UT_distance \u003c= 15)\n            {\n                Motor(Stop, 0);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 2; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Backward, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 12; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Clockwise, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 4; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                Motor(Stop, 0);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 2; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Backward, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 6; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Contrarotate, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 12; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n            }\n        }\n        else\n        {\n            Motor(Forward, 180);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n        {\n            Avoidance_Function_flag = false;\n        }\n    }\n}\n\nvoid Following_Function()           // Follow the pattern\n{\n    Following_Function_flag = true;\n    while (Following_Function_flag)\n    {\n        if (UT_distance \u003c 15)\n        {\n            Motor(Backward, 200);\n        }\n        else if (15 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 20)\n        {\n            Motor(Stop, 0);\n        }\n        else if (20 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 25)\n        {\n            Motor(Forward, 180);\n        }\n        else if (25 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 50)\n        {\n            Motor(Forward, 220);\n        }\n        else\n        {\n            Motor(Stop, 0);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x10)\n        {\n            Following_Function_flag = false;\n        }\n    }\n}\n\nvoid Jail_Function()                // Dungeon mode\n{\n    int i;\n    Jail_Function_flag = true;\n    while (Jail_Function_flag)\n    {\n        Left_Tra_Value = analogRead(LEFT_LINE_TRACJING);\n        Center_Tra_Value = analogRead(CENTER_LINE_TRACJING);\n        Right_Tra_Value = analogRead(right_LINE_TRACJING);\n        if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Forward, 150);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Backward,150);\n            /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Backward,150);\n             /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Backward,150);\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Contrarotate,160);\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Backward,150);\n             /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Contrarotate,160);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else\n        {\n            Motor(Backward,150);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n        {\n            Jail_Function_flag = false;\n        }\n    }\n}\n\nvoid auto_doit()                      // Automatic mode\n{\n    if (0 != auto_count)\n    {\n        menory_action_flag = true;\n    }\n    actions_count = 0;\n    claw_degrees = clawservo.read();\n    arm_degrees = armservo.read();\n    base_degrees = baseservo.read();\n    while (menory_action_flag)\n    {\n        for (int i = (1); i \u003c= (auto_count); i = i + (1))\n        {\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n            {\n                while (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees + 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (claw_degrees \u003e claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees - 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n            {\n                while (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees + 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (arm_degrees \u003e arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees - 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (base_degrees \u003c base_read_degress[(int)(i - 1)])\n            {\n                while (base_degrees \u003c base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees + 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (base_degrees \u003e base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees - 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n        }\n    }\n}\n\nvoid free_mode()                    // free mode\n{\n    if(RX_buffer.x_axis \u003e= -30 \u0026\u0026 RX_buffer.x_axis \u003c= 30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Forward\n    {\n        Motor(Forward, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= -30 \u0026\u0026 RX_buffer.x_axis \u003c= 30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Backward\n    {\n        Motor(Backward, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_axis \u003e= -30 \u0026\u0026 RX_buffer.y_axis \u003c= 30 \u0026\u0026 RX_buffer.x_axis \u003c= -30)     //Turn_Left\n    {\n        Motor(Turn_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_axis \u003e= -30 \u0026\u0026 RX_buffer.y_axis \u003c= 30 \u0026\u0026 RX_buffer.x_axis \u003e= 30)     //Turn_Right\n    {\n        Motor(Turn_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003c= -30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Top_Left\n    {\n        Motor(Top_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003c= -30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Bottom_Left\n    {\n        Motor(Bottom_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= 30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Top_Right\n    {\n        Motor(Top_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= 30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Bottom_Right\n    {\n        Motor(Bottom_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x04)     //Contrarotate\n    {\n        Motor(Contrarotate, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x08)     //Clockwise\n    {\n        Motor(Clockwise, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_Arm \u003c= 30 \u0026\u0026 RX_buffer.y_Arm \u003e= -30 \u0026\u0026 RX_buffer.x_Base \u003c= -30)    // base_left\n    {\n        base_degrees = base_degrees + 1;\n        if (base_degrees \u003e= 185) \n        {\n            base_degrees = 185;\n        }\n        baseservo.write(base_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.y_Arm \u003c= 30 \u0026\u0026 RX_buffer.y_Arm \u003e= -30 \u0026\u0026 RX_buffer.x_Base \u003e= 30)     // base_right\n    {\n        base_degrees = base_degrees - 1;\n        if (base_degrees \u003c= 0) \n        {\n            base_degrees = 0;\n        }\n        baseservo.write(base_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.x_Base \u003c= 30 \u0026\u0026 RX_buffer.x_Base \u003e= -30 \u0026\u0026 RX_buffer.y_Arm \u003c= -30)    // Arm contraction\n    {\n        arm_degrees = arm_degrees - 1;\n        if (arm_degrees \u003c= 0) \n        {\n            arm_degrees = 0;\n        }\n        armservo.write(arm_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.x_Base \u003c= 30 \u0026\u0026 RX_buffer.x_Base \u003e= -30 \u0026\u0026 RX_buffer.y_Arm \u003e= 30)     // Arm elongation\n    {\n        arm_degrees = arm_degrees + 1;\n        if (arm_degrees \u003e= 150) \n        {\n            arm_degrees = 150;\n        }\n        armservo.write(arm_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x01)            // claws open                                        \n    {\n        claw_degrees = claw_degrees - 1;\n        if (claw_degrees \u003c= 50) \n        {\n            claw_degrees = 50;\n        }\n        clawservo.write(claw_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x02)            // claws closed\n    {\n        claw_degrees = claw_degrees + 1;\n        if (claw_degrees \u003e= 150) \n        {\n            claw_degrees = 150;\n        }\n        clawservo.write(claw_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode1 \u0026 0x20)            // save\n    {\n        read_degress();\n    }  \n    else\n    {\n        Motor(Stop, 0);\n    }\n}\n\nvoid read_degress()\n{\n    if (actions_count \u003c= 19)\n    {\n        claw_read_degress[(int)((actions_count + 1) - 1)] = clawservo.read();\n        delay(50);\n        RX_Information(); \n        arm_read_degress[(int)((actions_count + 1) - 1)] = armservo.read();\n        delay(50);\n        RX_Information(); \n        base_read_degress[(int)((actions_count + 1) - 1)] = baseservo.read();\n        delay(50);\n        RX_Information(); \n        actions_count = actions_count + 1;\n        auto_count = actions_count;\n    }\n}\n\nvoid auto_do()\n{\n    if (0 != auto_count)\n    {\n        menory_action_flag = true;\n    }\n    actions_count = 0;\n    claw_degrees = clawservo.read();\n    arm_degrees = armservo.read();\n    base_degrees = baseservo.read();\n    while (menory_action_flag)\n    {\n        for (int i = (1); i \u003c= (auto_count); i = i + (1))\n        {\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n            {\n                while (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees + 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (claw_degrees \u003e claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees - 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n            {\n                while (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees + 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (arm_degrees \u003e arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees - 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (base_degrees \u003c base_read_degress[(int)(i - 1)])\n            {\n                while (base_degrees \u003c base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees + 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (base_degrees \u003e base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees - 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n        }\n    }\n}\n\nvoid Motor(int Dir, int Speed)      // Motor drive\n{\n    digitalWrite(EN_PIN, LOW);\n    analogWrite(PWM1_PIN, Speed);\n    analogWrite(PWM2_PIN, Speed);\n\n    digitalWrite(STCP_PIN, LOW);\n    shiftOut(DATA_PIN, SHCP_PIN, MSBFIRST, Dir);\n    digitalWrite(STCP_PIN, HIGH);\n}\n\nfloat SR04(int Trig, int Echo)      // Ultrasonic distance measurement\n{\n    digitalWrite(Trig, LOW);\n    delayMicroseconds(2);\n    digitalWrite(Trig, HIGH);\n    delayMicroseconds(10);\n    digitalWrite(Trig, LOW);\n    float distance = pulseIn(Echo, HIGH) / 58.00;\n    delay(10);\n    return distance;\n}\n\nvoid TX_Information(byte dis, byte act)     // Sending data packets\n{\n    int check;\n    if(dis\u003e127) dis = 127;\n    if(act\u003e127) act = 127;\n    TX_package[1] = dis;\n    TX_package[2] = act;\n    TX_package[3] = byte(dis + act);                        // The sum of inspection                              \n    Serial.write(TX_package, 5);                            // Sending data packets\n}\n\nvoid RX_Information(void)                   // Receiving data packet\n{\n    if(Serial.available() \u003e 0)\n    {\n        delay(1);                                           // delay 1MS\n        if(Serial.readBytes(RX_package, 10))\n        {\n            if (RX_package[0] == 0xA5 \u0026\u0026 RX_package[9] == 0x5A)     // The header and tail of the packet are verified\n            {\n                Serialcount = 0;\n                RX_buffer.mode1 = RX_package[1];\n                RX_buffer.mode2 = RX_package[2];\n                RX_buffer.x_axis = RX_package[3];\n                RX_buffer.y_axis = RX_package[4];\n                RX_buffer.C_speed = RX_package[5] + 127;\n                RX_buffer.x_Base = RX_package[6];\n                RX_buffer.y_Arm = RX_package[7];\n            }\n            else\n            {\n                Serialcount++;\n                return;\n            }\n        }\n    }\n    else\n    {\n        delay(1);\n        Serialcount++;\n        if(Serialcount \u003e 500)\n        {\n            Serialcount = 0;\n            RX_buffer.mode1 = 0; \n            RX_buffer.mode2 = 0;\n            RX_buffer.x_axis = 0;\n            RX_buffer.y_axis = 0;\n            RX_buffer.x_Base = 0;\n            RX_buffer.y_Arm = 0;\n            Line_tracking_Function_flag = false;\n            Avoidance_Function_flag = false;\n            Following_Function_flag = false;\n            Jail_Function_flag = false;\n        }\n    }\n}\n"}]}}
<<<
Content-Length: 111

{"id":1,"jsonrpc":"2.0","method":"window/workDoneProgress/create","params":{"token":"backgroundIndexProgress"}}
>>>
Content-Length: 38

{"jsonrpc":"2.0","id":1,"result":null}
<<<
Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"begin","percentage":0,"title":"indexing"}}}Content-Length: 141

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/1","percentage":0}}}Content-Length: 141

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/1","percentage":0}}}Content-Length: 107

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"end"}}}
>>>
Content-Length: 241

{"jsonrpc":"2.0","id":"4","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"position":{"line":26,"character":41}}}
<<<
Content-Length: 40

{"id":"4","jsonrpc":"2.0","result":null}
>>>
Content-Length: 241

{"jsonrpc":"2.0","id":"5","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"position":{"line":22,"character":27}}}
<<<
Content-Length: 40

{"id":"5","jsonrpc":"2.0","result":null}
>>>
Content-Length: 241

{"jsonrpc":"2.0","id":"6","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"position":{"line":23,"character":25}}}
<<<
Content-Length: 40

{"id":"6","jsonrpc":"2.0","result":null}
>>>
Content-Length: 253

{"jsonrpc":"2.0","id":"7","method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"position":{"line":23,"character":30}}}
<<<
Content-Length: 38

{"id":"7","jsonrpc":"2.0","result":[]}
>>>
Content-Length: 315

{"jsonrpc":"2.0","id":"8","method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"range":{"start":{"line":23,"character":30},"end":{"line":23,"character":30}},"context":{"diagnostics":[]}}}
<<<
Content-Length: 38

{"id":"8","jsonrpc":"2.0","result":[]}
>>>
Content-Length: 253

{"jsonrpc":"2.0","id":"9","method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"position":{"line":22,"character":30}}}
<<<
Content-Length: 38

{"id":"9","jsonrpc":"2.0","result":[]}
>>>
Content-Length: 316

{"jsonrpc":"2.0","id":"10","method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"range":{"start":{"line":22,"character":30},"end":{"line":22,"character":30}},"context":{"diagnostics":[]}}}
<<<
Content-Length: 39

{"id":"10","jsonrpc":"2.0","result":[]}
>>>
Content-Length: 254

{"jsonrpc":"2.0","id":"11","method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"position":{"line":21,"character":29}}}
<<<
Content-Length: 39

{"id":"11","jsonrpc":"2.0","result":[]}
>>>
Content-Length: 316

{"jsonrpc":"2.0","id":"12","method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"range":{"start":{"line":21,"character":29},"end":{"line":21,"character":29}},"context":{"diagnostics":[]}}}
<<<
Content-Length: 39

{"id":"12","jsonrpc":"2.0","result":[]}
>>>
Content-Length: 254

{"jsonrpc":"2.0","id":"13","method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"position":{"line":22,"character":30}}}
<<<
Content-Length: 39

{"id":"13","jsonrpc":"2.0","result":[]}
>>>
Content-Length: 316

{"jsonrpc":"2.0","id":"14","method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"range":{"start":{"line":22,"character":30},"end":{"line":22,"character":30}},"context":{"diagnostics":[]}}}
<<<
Content-Length: 39

{"id":"14","jsonrpc":"2.0","result":[]}
>>>
Content-Length: 254

{"jsonrpc":"2.0","id":"15","method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"position":{"line":21,"character":29}}}
<<<
Content-Length: 39

{"id":"15","jsonrpc":"2.0","result":[]}
>>>
Content-Length: 316

{"jsonrpc":"2.0","id":"16","method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"range":{"start":{"line":21,"character":29},"end":{"line":21,"character":29}},"context":{"diagnostics":[]}}}
<<<
Content-Length: 39

{"id":"16","jsonrpc":"2.0","result":[]}
>>>
Content-Length: 242

{"jsonrpc":"2.0","id":"17","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"position":{"line":23,"character":25}}}
<<<
Content-Length: 41

{"id":"17","jsonrpc":"2.0","result":null}
>>>
Content-Length: 242

{"jsonrpc":"2.0","id":"18","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"position":{"line":23,"character":29}}}
<<<
Content-Length: 41

{"id":"18","jsonrpc":"2.0","result":null}
>>>
Content-Length: 242

{"jsonrpc":"2.0","id":"19","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"position":{"line":25,"character":42}}}
<<<
Content-Length: 41

{"id":"19","jsonrpc":"2.0","result":null}
>>>
Content-Length: 196

{"jsonrpc":"2.0","method":"textDocument/didSave","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"}}}Content-Length: 39090

{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp","version":3},"contentChanges":[{"text":"#include \u003cArduino.h\u003e\n#line 1 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\n#include \u003cMsTimer2.h\u003e\n#include    \u003cServo.h\u003e\n\n// PWM control pin\n#define PWM1_PIN            5\n#define PWM2_PIN            6\n// 74HCT595N chip pin\n#define SHCP_PIN            2                               // The displacement of the clock\n#define EN_PIN              7                               // Can make control\n#define DATA_PIN            8                               // Serial data\n#define STCP_PIN            4                               // Memory register clock                  \n// Ultrasonic control pin\nconst int Trig       =      12;\nconst int Echo       =      13;\n// Trace the control pin\n#define LEFT_LINE_TRACJING      A0\n#define CENTER_LINE_TRACJING    A1\n#define right_LINE_TRACJING     A2\n// Servo control pin\n#define CLAW_PIN            9\n#define ARM_PIN             10\n#define BASE_PIN            11\n\nconst int Forward       = 92;                               // Forward\nconst int Backward      = 163;                              // Backward\nconst int Turn_Left     = 149;                              // Left translation\nconst int Turn_Right    = 106;                              // Right translation\nconst int Top_Left      = 20;                               // Upper left mobile\nconst int Bottom_Left   = 129;                              // Lower left mobile\nconst int Top_Right     = 72;                               // Upper right mobile\nconst int Bottom_Right  = 34;                               // The lower right move\nconst int Stop          = 0;                                // Stop\nconst int Contrarotate  = 172;                              // Counterclockwise rotation\nconst int Clockwise     = 83;                               // Rotate clockwise\n\n\nbyte TX_package[5] = {0xA5, 0, 0, 0, 0x5A};                 // Packet header(0xA5) +  original data (n*byte) + inspection sum(1byte) + Package the tail(0x5A)\nbyte RX_package[10] = {0};\nint UT_distance = 0;\nint Serialcount = 0;\nint base_degrees = 90;\nint arm_degrees = 90;\nint claw_degrees = 90;\nboolean menory_action_flag;\nboolean Line_tracking_Function_flag = false;\nboolean Avoidance_Function_flag = false;\nboolean Following_Function_flag = false;\nboolean Jail_Function_flag = false;\nint Left_Tra_Value;\nint Center_Tra_Value;\nint Right_Tra_Value;\nint Black_Line = 500;\nint actions_count = 0;\nint auto_count;\nint claw_read_degress[20] = {0, 0, 0};\nint arm_read_degress[20] = {0, 0, 0};\nint base_read_degress[20] = {0, 0, 0};\n\ntypedef struct \n{\n    byte mode1;             // Bit0: free mode;Bit1: tracking mode;Bit2: Obstacle avoidance mode;Bit3: Follow mode;\n                            // Bit4: Dungeon Mode;Bit5: Save button;Bit6: Automatic button;Bit7: empty\n    byte mode2;             // Bit0: fluke;Bit1: closed claw;Bit2: clockwise rotation;Bit3: reverse;\n    char x_axis = 0;        // Store variables on the X axis\n    char y_axis = 0;        // Store the variables on the Y axis\n    byte C_speed = 127;     // Speed of storage cart\n    char x_Base = 0;        // Store the steering gear on the X axis\n    char y_Arm = 0;         // Store the steering gear on the Y-axis\n}rx_buffer;\n\nrx_buffer RX_buffer;\n\nServo clawservo;\nServo armservo;\nServo baseservo;\n\n#line 77 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Timer2Isr();\n#line 82 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid setup();\n#line 117 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid loop();\n#line 154 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Line_tracking_Function();\n#line 194 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Avoidance_Function();\n#line 293 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Following_Function();\n#line 326 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Jail_Function();\n#line 476 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid auto_doit();\n#line 608 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid free_mode();\n#line 730 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid read_degress();\n#line 748 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid auto_do();\n#line 880 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Motor(int Dir, int Speed);\n#line 891 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nfloat SR04(int Trig, int Echo);\n#line 903 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid TX_Information(byte dis, byte act);\n#line 914 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid RX_Information(void);\n#line 77 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Timer2Isr()\n{\n    sei();\n    UT_distance = SR04(Trig, Echo);\n}\nvoid setup()\n{\n    pinMode(SHCP_PIN, OUTPUT);\n    pinMode(EN_PIN, OUTPUT);\n    pinMode(DATA_PIN, OUTPUT);\n    pinMode(STCP_PIN, OUTPUT);\n    pinMode(PWM1_PIN, OUTPUT);\n    pinMode(PWM2_PIN, OUTPUT);\n\n    pinMode(Trig, OUTPUT);\n    pinMode(Echo, INPUT);\n\n    pinMode(LEFT_LINE_TRACJING, INPUT);\n    pinMode(CENTER_LINE_TRACJING, INPUT);\n    pinMode(right_LINE_TRACJING, INPUT);\n\n    clawservo.attach(CLAW_PIN);\n    armservo.attach(ARM_PIN);\n    baseservo.attach(BASE_PIN);\n    clawservo.write(claw_degrees);\n    delay(500);\n    armservo.write(arm_degrees);\n    delay(500);\n    baseservo.write(base_degrees);\n    delay(500);\n\n    Motor(Stop, 0);\n\n    Serial.begin(9600);\n\n    //5ms timed interrupt Settings use timer2    \n    MsTimer2::set(100, Timer2Isr);\n    MsTimer2::start();\n}\n\nvoid loop()\n{\n    TX_Information(UT_distance, auto_count);                    // Send ultrasonic data\n    RX_Information();                                           // Receiving Bluetooth data\n    switch (RX_buffer.mode1)\n    {\n        case 0x02:       //tracking mode\n            Motor(Stop, 0);\n            Line_tracking_Function();\n            delay(10);\n            break;\n        case 0x04:       //Obstacle avoidance mode\n            Motor(Stop, 0);\n            Avoidance_Function();\n            delay(10);\n            break;\n        case 0x08:       //Follow the pattern\n            Motor(Stop, 0);\n            Following_Function();\n            delay(10);\n            break;\n        case 0x10:       //Dungeon mode\n            Motor(Stop, 0);\n            Jail_Function();\n            delay(10);\n            break;\n        case 0x40:       //Automatic mode\n            Motor(Stop, 0);\n            auto_doit();\n            delay(10);\n            break;\n        default:\n            free_mode();\n            break;\n    }\n}\n\nvoid Line_tracking_Function()       // tracking mode\n{\n    Line_tracking_Function_flag = true;\n    while (Line_tracking_Function_flag)\n    {\n        Left_Tra_Value = analogRead(LEFT_LINE_TRACJING);\n        Center_Tra_Value = analogRead(CENTER_LINE_TRACJING);\n        Right_Tra_Value = analogRead(right_LINE_TRACJING);\n        if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Forward, 175);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Contrarotate, 165);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Contrarotate, 190);\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Clockwise, 190);\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Clockwise, 165);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Stop, 0);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n        {\n            Line_tracking_Function_flag = false;\n        }\n    }\n}\n\nvoid Avoidance_Function()           // Obstacle avoidance mode\n{\n    int i;\n    Avoidance_Function_flag = true;\n    while (Avoidance_Function_flag)\n    {\n        if (UT_distance \u003c= 25)\n        {\n            if (UT_distance \u003c= 15)\n            {\n                Motor(Stop, 0);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 2; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Backward, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 12; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Clockwise, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 4; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                Motor(Stop, 0);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 2; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Backward, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 6; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Contrarotate, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 12; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n            }\n        }\n        else\n        {\n            Motor(Forward, 180);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n        {\n            Avoidance_Function_flag = false;\n        }\n    }\n}\n\nvoid Following_Function()           // Follow the pattern\n{\n    Following_Function_flag = true;\n    while (Following_Function_flag)\n    {\n        if (UT_distance \u003c 15)\n        {\n            Motor(Backward, 200);\n        }\n        else if (15 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 20)\n        {\n            Motor(Stop, 0);\n        }\n        else if (20 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 25)\n        {\n            Motor(Forward, 180);\n        }\n        else if (25 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 50)\n        {\n            Motor(Forward, 220);\n        }\n        else\n        {\n            Motor(Stop, 0);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x10)\n        {\n            Following_Function_flag = false;\n        }\n    }\n}\n\nvoid Jail_Function()                // Dungeon mode\n{\n    int i;\n    Jail_Function_flag = true;\n    while (Jail_Function_flag)\n    {\n        Left_Tra_Value = analogRead(LEFT_LINE_TRACJING);\n        Center_Tra_Value = analogRead(CENTER_LINE_TRACJING);\n        Right_Tra_Value = analogRead(right_LINE_TRACJING);\n        if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Forward, 150);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Backward,150);\n            /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Backward,150);\n             /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Backward,150);\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Contrarotate,160);\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Backward,150);\n             /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Contrarotate,160);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else\n        {\n            Motor(Backward,150);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n        {\n            Jail_Function_flag = false;\n        }\n    }\n}\n\nvoid auto_doit()                      // Automatic mode\n{\n    if (0 != auto_count)\n    {\n        menory_action_flag = true;\n    }\n    actions_count = 0;\n    claw_degrees = clawservo.read();\n    arm_degrees = armservo.read();\n    base_degrees = baseservo.read();\n    while (menory_action_flag)\n    {\n        for (int i = (1); i \u003c= (auto_count); i = i + (1))\n        {\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n            {\n                while (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees + 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (claw_degrees \u003e claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees - 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n            {\n                while (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees + 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (arm_degrees \u003e arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees - 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (base_degrees \u003c base_read_degress[(int)(i - 1)])\n            {\n                while (base_degrees \u003c base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees + 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (base_degrees \u003e base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees - 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n        }\n    }\n}\n\nvoid free_mode()                    // free mode\n{\n    if(RX_buffer.x_axis \u003e= -30 \u0026\u0026 RX_buffer.x_axis \u003c= 30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Forward\n    {\n        Motor(Forward, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= -30 \u0026\u0026 RX_buffer.x_axis \u003c= 30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Backward\n    {\n        Motor(Backward, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_axis \u003e= -30 \u0026\u0026 RX_buffer.y_axis \u003c= 30 \u0026\u0026 RX_buffer.x_axis \u003c= -30)     //Turn_Left\n    {\n        Motor(Turn_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_axis \u003e= -30 \u0026\u0026 RX_buffer.y_axis \u003c= 30 \u0026\u0026 RX_buffer.x_axis \u003e= 30)     //Turn_Right\n    {\n        Motor(Turn_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003c= -30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Top_Left\n    {\n        Motor(Top_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003c= -30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Bottom_Left\n    {\n        Motor(Bottom_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= 30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Top_Right\n    {\n        Motor(Top_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= 30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Bottom_Right\n    {\n        Motor(Bottom_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x04)     //Contrarotate\n    {\n        Motor(Contrarotate, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x08)     //Clockwise\n    {\n        Motor(Clockwise, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_Arm \u003c= 30 \u0026\u0026 RX_buffer.y_Arm \u003e= -30 \u0026\u0026 RX_buffer.x_Base \u003c= -30)    // base_left\n    {\n        base_degrees = base_degrees + 1;\n        if (base_degrees \u003e= 185) \n        {\n            base_degrees = 185;\n        }\n        baseservo.write(base_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.y_Arm \u003c= 30 \u0026\u0026 RX_buffer.y_Arm \u003e= -30 \u0026\u0026 RX_buffer.x_Base \u003e= 30)     // base_right\n    {\n        base_degrees = base_degrees - 1;\n        if (base_degrees \u003c= 0) \n        {\n            base_degrees = 0;\n        }\n        baseservo.write(base_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.x_Base \u003c= 30 \u0026\u0026 RX_buffer.x_Base \u003e= -30 \u0026\u0026 RX_buffer.y_Arm \u003c= -30)    // Arm contraction\n    {\n        arm_degrees = arm_degrees - 1;\n        if (arm_degrees \u003c= 0) \n        {\n            arm_degrees = 0;\n        }\n        armservo.write(arm_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.x_Base \u003c= 30 \u0026\u0026 RX_buffer.x_Base \u003e= -30 \u0026\u0026 RX_buffer.y_Arm \u003e= 30)     // Arm elongation\n    {\n        arm_degrees = arm_degrees + 1;\n        if (arm_degrees \u003e= 150) \n        {\n            arm_degrees = 150;\n        }\n        armservo.write(arm_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x01)            // claws open                                        \n    {\n        claw_degrees = claw_degrees - 1;\n        if (claw_degrees \u003c= 50) \n        {\n            claw_degrees = 50;\n        }\n        clawservo.write(claw_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x02)            // claws closed\n    {\n        claw_degrees = claw_degrees + 1;\n        if (claw_degrees \u003e= 150) \n        {\n            claw_degrees = 150;\n        }\n        clawservo.write(claw_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode1 \u0026 0x20)            // save\n    {\n        read_degress();\n    }  \n    else\n    {\n        Motor(Stop, 0);\n    }\n}\n\nvoid read_degress()\n{\n    if (actions_count \u003c= 19)\n    {\n        claw_read_degress[(int)((actions_count + 1) - 1)] = clawservo.read();\n        delay(50);\n        RX_Information(); \n        arm_read_degress[(int)((actions_count + 1) - 1)] = armservo.read();\n        delay(50);\n        RX_Information(); \n        base_read_degress[(int)((actions_count + 1) - 1)] = baseservo.read();\n        delay(50);\n        RX_Information(); \n        actions_count = actions_count + 1;\n        auto_count = actions_count;\n    }\n}\n\nvoid auto_do()\n{\n    if (0 != auto_count)\n    {\n        menory_action_flag = true;\n    }\n    actions_count = 0;\n    claw_degrees = clawservo.read();\n    arm_degrees = armservo.read();\n    base_degrees = baseservo.read();\n    while (menory_action_flag)\n    {\n        for (int i = (1); i \u003c= (auto_count); i = i + (1))\n        {\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n            {\n                while (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees + 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (claw_degrees \u003e claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees - 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n            {\n                while (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees + 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (arm_degrees \u003e arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees - 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (base_degrees \u003c base_read_degress[(int)(i - 1)])\n            {\n                while (base_degrees \u003c base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees + 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (base_degrees \u003e base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees - 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n        }\n    }\n}\n\nvoid Motor(int Dir, int Speed)      // Motor drive\n{\n    digitalWrite(EN_PIN, LOW);\n    analogWrite(PWM1_PIN, Speed);\n    analogWrite(PWM2_PIN, Speed);\n\n    digitalWrite(STCP_PIN, LOW);\n    shiftOut(DATA_PIN, SHCP_PIN, MSBFIRST, Dir);\n    digitalWrite(STCP_PIN, HIGH);\n}\n\nfloat SR04(int Trig, int Echo)      // Ultrasonic distance measurement\n{\n    digitalWrite(Trig, LOW);\n    delayMicroseconds(2);\n    digitalWrite(Trig, HIGH);\n    delayMicroseconds(10);\n    digitalWrite(Trig, LOW);\n    float distance = pulseIn(Echo, HIGH) / 58.00;\n    delay(10);\n    return distance;\n}\n\nvoid TX_Information(byte dis, byte act)     // Sending data packets\n{\n    int check;\n    if(dis\u003e127) dis = 127;\n    if(act\u003e127) act = 127;\n    TX_package[1] = dis;\n    TX_package[2] = act;\n    TX_package[3] = byte(dis + act);                        // The sum of inspection                              \n    Serial.write(TX_package, 5);                            // Sending data packets\n}\n\nvoid RX_Information(void)                   // Receiving data packet\n{\n    if(Serial.available() \u003e 0)\n    {\n        delay(1);                                           // delay 1MS\n        if(Serial.readBytes(RX_package, 10))\n        {\n            if (RX_package[0] == 0xA5 \u0026\u0026 RX_package[9] == 0x5A)     // The header and tail of the packet are verified\n            {\n                Serialcount = 0;\n                RX_buffer.mode1 = RX_package[1];\n                RX_buffer.mode2 = RX_package[2];\n                RX_buffer.x_axis = RX_package[3];\n                RX_buffer.y_axis = RX_package[4];\n                RX_buffer.C_speed = RX_package[5] + 127;\n                RX_buffer.x_Base = RX_package[6];\n                RX_buffer.y_Arm = RX_package[7];\n            }\n            else\n            {\n                Serialcount++;\n                return;\n            }\n        }\n    }\n    else\n    {\n        delay(1);\n        Serialcount++;\n        if(Serialcount \u003e 500)\n        {\n            Serialcount = 0;\n            RX_buffer.mode1 = 0; \n            RX_buffer.mode2 = 0;\n            RX_buffer.x_axis = 0;\n            RX_buffer.y_axis = 0;\n            RX_buffer.x_Base = 0;\n            RX_buffer.y_Arm = 0;\n            Line_tracking_Function_flag = false;\n            Avoidance_Function_flag = false;\n            Following_Function_flag = false;\n            Jail_Function_flag = false;\n        }\n    }\n}\n"}]}}
<<<
Content-Length: 111

{"id":2,"jsonrpc":"2.0","method":"window/workDoneProgress/create","params":{"token":"backgroundIndexProgress"}}
>>>
Content-Length: 38

{"jsonrpc":"2.0","id":2,"result":null}
<<<
Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"begin","percentage":0,"title":"indexing"}}}Content-Length: 141

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/1","percentage":0}}}Content-Length: 141

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/1","percentage":0}}}Content-Length: 107

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"end"}}}
>>>
Content-Length: 242

{"jsonrpc":"2.0","id":"20","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"position":{"line":14,"character":14}}}
<<<
Content-Length: 296

{"id":"20","jsonrpc":"2.0","result":{"contents":{"kind":"markdown","value":"### variable `Trig`  \n\n---\nType: `const int`  \nValue = `12 (0xc)`  \nUltrasonic control pin  \n\n---\n```cpp\nconst int Trig = 12\n```"},"range":{"end":{"character":14,"line":14},"start":{"character":10,"line":14}}}}
>>>
Content-Length: 242

{"jsonrpc":"2.0","id":"21","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server3557012346/sketch/6_BlueTooth.ino.cpp"},"position":{"line":20,"character":18}}}
<<<
Content-Length: 41

{"id":"21","jsonrpc":"2.0","result":null}
>>>
Content-Length: 61

{"jsonrpc":"2.0","id":"22","method":"shutdown","params":null}
<<<
Content-Length: 41

{"id":"22","jsonrpc":"2.0","result":null}
>>>
Content-Length: 47

{"jsonrpc":"2.0","method":"exit","params":null}






Started logging.

>>>
Content-Length: 3213

{"jsonrpc":"2.0","id":"1","method":"initialize","params":{"processId":8876,"clientInfo":{"name":"vscode","version":"1.53.2"},"rootPath":"C:\\Users\\Administrator\\AppData\\Local\\Temp\\arduino-language-server266849184\\sketch","rootUri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server266849184/sketch","initializationOptions":{},"capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"workspaceFolders":true,"configuration":true},"textDocument":{"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]},"contextSupport":true},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}},"contextSupport":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true},"codeAction":{"dynamicRegistration":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"isPreferredSupport":true},"codeLens":{"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"colorProvider":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"publishDiagnostics":{"relatedInformation":true,"tagSupport":{"valueSet":[1,2]}},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"selectionRange":{"dynamicRegistration":true}},"window":{"workDoneProgress":true}},"trace":"off","workspaceFolders":[{"uri":"file:///e%3A/5-%E6%95%99%E7%A8%8B/1.tutorial/ZYC0072%E6%9C%BA%E6%A2%B0%E6%89%8B%E5%B0%8F%E8%BD%A6/ZYC0072/4.%20Tutorial_Arduino/4_Arduino%20Code/6_BlueTooth","name":"6_BlueTooth"}]}}
<<<
Content-Length: 1905

{"id":"1","jsonrpc":"2.0","result":{"capabilities":{"astProvider":true,"callHierarchyProvider":true,"clangdInlayHintsProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor","info"]},"compilationDatabase":{"automaticReload":true},"completionProvider":{"allCommitCharacters":[" ","\t","(",")","[","]","{","}","<",">",":",";",",","+","-","/","*","%","^","&","#","?",".","=","\"","'","|"],"resolveProvider":false,"triggerCharacters":[".","<",">",":","\"","/","*"]},"declarationProvider":true,"definitionProvider":true,"documentFormattingProvider":true,"documentHighlightProvider":true,"documentLinkProvider":{"resolveProvider":false},"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"\n","moreTriggerCharacter":[]},"documentRangeFormattingProvider":true,"documentSymbolProvider":true,"executeCommandProvider":{"commands":["clangd.applyFix","clangd.applyTweak"]},"hoverProvider":true,"implementationProvider":true,"memoryUsageProvider":true,"referencesProvider":true,"renameProvider":{"prepareProvider":true},"selectionRangeProvider":true,"semanticTokensProvider":{"full":{"delta":true},"legend":{"tokenModifiers":["declaration","deprecated","deduced","readonly","static","abstract","virtual","dependentName","defaultLibrary","usedAsMutableReference","functionScope","classScope","fileScope","globalScope"],"tokenTypes":["variable","variable","parameter","function","method","function","property","variable","class","interface","enum","enumMember","type","type","unknown","namespace","typeParameter","concept","type","macro","comment"]},"range":false},"signatureHelpProvider":{"triggerCharacters":["(",")","{","}","<",">",","]},"textDocumentSync":{"change":2,"openClose":true,"save":true},"typeDefinitionProvider":true,"typeHierarchyProvider":true,"workspaceSymbolProvider":true},"serverInfo":{"name":"clangd","version":"clangd version 14.0.0 windows x86_64-pc-windows-msvc"}}}
>>>
Content-Length: 52

{"jsonrpc":"2.0","method":"initialized","params":{}}Content-Length: 39085

{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server266849184/sketch/6_BlueTooth.ino.cpp","languageId":"cpp","version":1,"text":"#include \u003cArduino.h\u003e\n#line 1 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\n#include \u003cMsTimer2.h\u003e\n#include    \u003cServo.h\u003e\n\n// PWM control pin\n#define PWM1_PIN            5\n#define PWM2_PIN            6\n// 74HCT595N chip pin\n#define SHCP_PIN            2                               // The displacement of the clock\n#define EN_PIN              7                               // Can make control\n#define DATA_PIN            8                               // Serial data\n#define STCP_PIN            4                               // Memory register clock                  \n// Ultrasonic control pin\nconst int Trig       =      12;\nconst int Echo       =      13;\n// Trace the control pin\n#define LEFT_LINE_TRACJING      A0\n#define CENTER_LINE_TRACJING    A1\n#define right_LINE_TRACJING     A2\n// Servo control pin\n#define CLAW_PIN            9\n#define ARM_PIN             10\n#define BASE_PIN            11\n\nconst int Forward       = 92;                               // Forward\nconst int Backward      = 163;                              // Backward\nconst int Turn_Left     = 149;                              // Left translation\nconst int Turn_Right    = 106;                              // Right translation\nconst int Top_Left      = 20;                               // Upper left mobile\nconst int Bottom_Left   = 129;                              // Lower left mobile\nconst int Top_Right     = 72;                               // Upper right mobile\nconst int Bottom_Right  = 34;                               // The lower right move\nconst int Stop          = 0;                                // Stop\nconst int Contrarotate  = 172;                              // Counterclockwise rotation\nconst int Clockwise     = 83;                               // Rotate clockwise\n\n\nbyte TX_package[5] = {0xA5, 0, 0, 0, 0x5A};                 // Packet header(0xA5) +  original data (n*byte) + inspection sum(1byte) + Package the tail(0x5A)\nbyte RX_package[10] = {0};\nint UT_distance = 0;\nint Serialcount = 0;\nint base_degrees = 90;\nint arm_degrees = 90;\nint claw_degrees = 90;\nboolean menory_action_flag;\nboolean Line_tracking_Function_flag = false;\nboolean Avoidance_Function_flag = false;\nboolean Following_Function_flag = false;\nboolean Jail_Function_flag = false;\nint Left_Tra_Value;\nint Center_Tra_Value;\nint Right_Tra_Value;\nint Black_Line = 500;\nint actions_count = 0;\nint auto_count;\nint claw_read_degress[20] = {0, 0, 0};\nint arm_read_degress[20] = {0, 0, 0};\nint base_read_degress[20] = {0, 0, 0};\n\ntypedef struct \n{\n    byte mode1;             // Bit0: free mode;Bit1: tracking mode;Bit2: Obstacle avoidance mode;Bit3: Follow mode;\n                            // Bit4: Dungeon Mode;Bit5: Save button;Bit6: Automatic button;Bit7: empty\n    byte mode2;             // Bit0: fluke;Bit1: closed claw;Bit2: clockwise rotation;Bit3: reverse;\n    char x_axis = 0;        // Store variables on the X axis\n    char y_axis = 0;        // Store the variables on the Y axis\n    byte C_speed = 127;     // Speed of storage cart\n    char x_Base = 0;        // Store the steering gear on the X axis\n    char y_Arm = 0;         // Store the steering gear on the Y-axis\n}rx_buffer;\n\nrx_buffer RX_buffer;\n\nServo clawservo;\nServo armservo;\nServo baseservo;\n\n#line 77 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Timer2Isr();\n#line 82 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid setup();\n#line 117 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid loop();\n#line 154 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Line_tracking_Function();\n#line 194 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Avoidance_Function();\n#line 293 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Following_Function();\n#line 326 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Jail_Function();\n#line 476 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid auto_doit();\n#line 608 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid free_mode();\n#line 730 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid read_degress();\n#line 748 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid auto_do();\n#line 880 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Motor(int Dir, int Speed);\n#line 891 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nfloat SR04(int Trig, int Echo);\n#line 903 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid TX_Information(byte dis, byte act);\n#line 914 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid RX_Information(void);\n#line 77 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Timer2Isr()\n{\n    sei();\n    UT_distance = SR04(Trig, Echo);\n}\nvoid setup()\n{\n    pinMode(SHCP_PIN, OUTPUT);\n    pinMode(EN_PIN, OUTPUT);\n    pinMode(DATA_PIN, OUTPUT);\n    pinMode(STCP_PIN, OUTPUT);\n    pinMode(PWM1_PIN, OUTPUT);\n    pinMode(PWM2_PIN, OUTPUT);\n\n    pinMode(Trig, OUTPUT);\n    pinMode(Echo, INPUT);\n\n    pinMode(LEFT_LINE_TRACJING, INPUT);\n    pinMode(CENTER_LINE_TRACJING, INPUT);\n    pinMode(right_LINE_TRACJING, INPUT);\n\n    clawservo.attach(CLAW_PIN);\n    armservo.attach(ARM_PIN);\n    baseservo.attach(BASE_PIN);\n    clawservo.write(claw_degrees);\n    delay(500);\n    armservo.write(arm_degrees);\n    delay(500);\n    baseservo.write(base_degrees);\n    delay(500);\n\n    Motor(Stop, 0);\n\n    Serial.begin(9600);\n\n    //5ms timed interrupt Settings use timer2    \n    MsTimer2::set(100, Timer2Isr);\n    MsTimer2::start();\n}\n\nvoid loop()\n{\n    TX_Information(UT_distance, auto_count);                    // Send ultrasonic data\n    RX_Information();                                           // Receiving Bluetooth data\n    switch (RX_buffer.mode1)\n    {\n        case 0x02:       //tracking mode\n            Motor(Stop, 0);\n            Line_tracking_Function();\n            delay(10);\n            break;\n        case 0x04:       //Obstacle avoidance mode\n            Motor(Stop, 0);\n            Avoidance_Function();\n            delay(10);\n            break;\n        case 0x08:       //Follow the pattern\n            Motor(Stop, 0);\n            Following_Function();\n            delay(10);\n            break;\n        case 0x10:       //Dungeon mode\n            Motor(Stop, 0);\n            Jail_Function();\n            delay(10);\n            break;\n        case 0x40:       //Automatic mode\n            Motor(Stop, 0);\n            auto_doit();\n            delay(10);\n            break;\n        default:\n            free_mode();\n            break;\n    }\n}\n\nvoid Line_tracking_Function()       // tracking mode\n{\n    Line_tracking_Function_flag = true;\n    while (Line_tracking_Function_flag)\n    {\n        Left_Tra_Value = analogRead(LEFT_LINE_TRACJING);\n        Center_Tra_Value = analogRead(CENTER_LINE_TRACJING);\n        Right_Tra_Value = analogRead(right_LINE_TRACJING);\n        if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Forward, 175);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Contrarotate, 165);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Contrarotate, 190);\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Clockwise, 190);\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Clockwise, 165);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Stop, 0);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n        {\n            Line_tracking_Function_flag = false;\n        }\n    }\n}\n\nvoid Avoidance_Function()           // Obstacle avoidance mode\n{\n    int i;\n    Avoidance_Function_flag = true;\n    while (Avoidance_Function_flag)\n    {\n        if (UT_distance \u003c= 25)\n        {\n            if (UT_distance \u003c= 15)\n            {\n                Motor(Stop, 0);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 2; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Backward, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 12; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Clockwise, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 4; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                Motor(Stop, 0);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 2; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Backward, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 6; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Contrarotate, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 12; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n            }\n        }\n        else\n        {\n            Motor(Forward, 180);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n        {\n            Avoidance_Function_flag = false;\n        }\n    }\n}\n\nvoid Following_Function()           // Follow the pattern\n{\n    Following_Function_flag = true;\n    while (Following_Function_flag)\n    {\n        if (UT_distance \u003c 15)\n        {\n            Motor(Backward, 200);\n        }\n        else if (15 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 20)\n        {\n            Motor(Stop, 0);\n        }\n        else if (20 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 25)\n        {\n            Motor(Forward, 180);\n        }\n        else if (25 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 50)\n        {\n            Motor(Forward, 220);\n        }\n        else\n        {\n            Motor(Stop, 0);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x10)\n        {\n            Following_Function_flag = false;\n        }\n    }\n}\n\nvoid Jail_Function()                // Dungeon mode\n{\n    int i;\n    Jail_Function_flag = true;\n    while (Jail_Function_flag)\n    {\n        Left_Tra_Value = analogRead(LEFT_LINE_TRACJING);\n        Center_Tra_Value = analogRead(CENTER_LINE_TRACJING);\n        Right_Tra_Value = analogRead(right_LINE_TRACJING);\n        if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Forward, 150);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Backward,150);\n            /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Backward,150);\n             /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Backward,150);\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Contrarotate,160);\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Backward,150);\n             /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Contrarotate,160);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else\n        {\n            Motor(Backward,150);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n        {\n            Jail_Function_flag = false;\n        }\n    }\n}\n\nvoid auto_doit()                      // Automatic mode\n{\n    if (0 != auto_count)\n    {\n        menory_action_flag = true;\n    }\n    actions_count = 0;\n    claw_degrees = clawservo.read();\n    arm_degrees = armservo.read();\n    base_degrees = baseservo.read();\n    while (menory_action_flag)\n    {\n        for (int i = (1); i \u003c= (auto_count); i = i + (1))\n        {\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n            {\n                while (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees + 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (claw_degrees \u003e claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees - 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n            {\n                while (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees + 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (arm_degrees \u003e arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees - 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (base_degrees \u003c base_read_degress[(int)(i - 1)])\n            {\n                while (base_degrees \u003c base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees + 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (base_degrees \u003e base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees - 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n        }\n    }\n}\n\nvoid free_mode()                    // free mode\n{\n    if(RX_buffer.x_axis \u003e= -30 \u0026\u0026 RX_buffer.x_axis \u003c= 30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Forward\n    {\n        Motor(Forward, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= -30 \u0026\u0026 RX_buffer.x_axis \u003c= 30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Backward\n    {\n        Motor(Backward, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_axis \u003e= -30 \u0026\u0026 RX_buffer.y_axis \u003c= 30 \u0026\u0026 RX_buffer.x_axis \u003c= -30)     //Turn_Left\n    {\n        Motor(Turn_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_axis \u003e= -30 \u0026\u0026 RX_buffer.y_axis \u003c= 30 \u0026\u0026 RX_buffer.x_axis \u003e= 30)     //Turn_Right\n    {\n        Motor(Turn_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003c= -30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Top_Left\n    {\n        Motor(Top_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003c= -30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Bottom_Left\n    {\n        Motor(Bottom_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= 30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Top_Right\n    {\n        Motor(Top_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= 30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Bottom_Right\n    {\n        Motor(Bottom_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x04)     //Contrarotate\n    {\n        Motor(Contrarotate, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x08)     //Clockwise\n    {\n        Motor(Clockwise, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_Arm \u003c= 30 \u0026\u0026 RX_buffer.y_Arm \u003e= -30 \u0026\u0026 RX_buffer.x_Base \u003c= -30)    // base_left\n    {\n        base_degrees = base_degrees + 1;\n        if (base_degrees \u003e= 185) \n        {\n            base_degrees = 185;\n        }\n        baseservo.write(base_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.y_Arm \u003c= 30 \u0026\u0026 RX_buffer.y_Arm \u003e= -30 \u0026\u0026 RX_buffer.x_Base \u003e= 30)     // base_right\n    {\n        base_degrees = base_degrees - 1;\n        if (base_degrees \u003c= 0) \n        {\n            base_degrees = 0;\n        }\n        baseservo.write(base_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.x_Base \u003c= 30 \u0026\u0026 RX_buffer.x_Base \u003e= -30 \u0026\u0026 RX_buffer.y_Arm \u003c= -30)    // Arm contraction\n    {\n        arm_degrees = arm_degrees - 1;\n        if (arm_degrees \u003c= 0) \n        {\n            arm_degrees = 0;\n        }\n        armservo.write(arm_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.x_Base \u003c= 30 \u0026\u0026 RX_buffer.x_Base \u003e= -30 \u0026\u0026 RX_buffer.y_Arm \u003e= 30)     // Arm elongation\n    {\n        arm_degrees = arm_degrees + 1;\n        if (arm_degrees \u003e= 150) \n        {\n            arm_degrees = 150;\n        }\n        armservo.write(arm_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x01)            // claws open                                        \n    {\n        claw_degrees = claw_degrees - 1;\n        if (claw_degrees \u003c= 50) \n        {\n            claw_degrees = 50;\n        }\n        clawservo.write(claw_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x02)            // claws closed\n    {\n        claw_degrees = claw_degrees + 1;\n        if (claw_degrees \u003e= 150) \n        {\n            claw_degrees = 150;\n        }\n        clawservo.write(claw_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode1 \u0026 0x20)            // save\n    {\n        read_degress();\n    }  \n    else\n    {\n        Motor(Stop, 0);\n    }\n}\n\nvoid read_degress()\n{\n    if (actions_count \u003c= 19)\n    {\n        claw_read_degress[(int)((actions_count + 1) - 1)] = clawservo.read();\n        delay(50);\n        RX_Information(); \n        arm_read_degress[(int)((actions_count + 1) - 1)] = armservo.read();\n        delay(50);\n        RX_Information(); \n        base_read_degress[(int)((actions_count + 1) - 1)] = baseservo.read();\n        delay(50);\n        RX_Information(); \n        actions_count = actions_count + 1;\n        auto_count = actions_count;\n    }\n}\n\nvoid auto_do()\n{\n    if (0 != auto_count)\n    {\n        menory_action_flag = true;\n    }\n    actions_count = 0;\n    claw_degrees = clawservo.read();\n    arm_degrees = armservo.read();\n    base_degrees = baseservo.read();\n    while (menory_action_flag)\n    {\n        for (int i = (1); i \u003c= (auto_count); i = i + (1))\n        {\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n            {\n                while (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees + 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (claw_degrees \u003e claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees - 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n            {\n                while (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees + 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (arm_degrees \u003e arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees - 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (base_degrees \u003c base_read_degress[(int)(i - 1)])\n            {\n                while (base_degrees \u003c base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees + 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (base_degrees \u003e base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees - 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n        }\n    }\n}\n\nvoid Motor(int Dir, int Speed)      // Motor drive\n{\n    digitalWrite(EN_PIN, LOW);\n    analogWrite(PWM1_PIN, Speed);\n    analogWrite(PWM2_PIN, Speed);\n\n    digitalWrite(STCP_PIN, LOW);\n    shiftOut(DATA_PIN, SHCP_PIN, MSBFIRST, Dir);\n    digitalWrite(STCP_PIN, HIGH);\n}\n\nfloat SR04(int Trig, int Echo)      // Ultrasonic distance measurement\n{\n    digitalWrite(Trig, LOW);\n    delayMicroseconds(2);\n    digitalWrite(Trig, HIGH);\n    delayMicroseconds(10);\n    digitalWrite(Trig, LOW);\n    float distance = pulseIn(Echo, HIGH) / 58.00;\n    delay(10);\n    return distance;\n}\n\nvoid TX_Information(byte dis, byte act)     // Sending data packets\n{\n    int check;\n    if(dis\u003e127) dis = 127;\n    if(act\u003e127) act = 127;\n    TX_package[1] = dis;\n    TX_package[2] = act;\n    TX_package[3] = byte(dis + act);                        // The sum of inspection                              \n    Serial.write(TX_package, 5);                            // Sending data packets\n}\n\nvoid RX_Information(void)                   // Receiving data packet\n{\n    if(Serial.available() \u003e 0)\n    {\n        delay(1);                                           // delay 1MS\n        if(Serial.readBytes(RX_package, 10))\n        {\n            if (RX_package[0] == 0xA5 \u0026\u0026 RX_package[9] == 0x5A)     // The header and tail of the packet are verified\n            {\n                Serialcount = 0;\n                RX_buffer.mode1 = RX_package[1];\n                RX_buffer.mode2 = RX_package[2];\n                RX_buffer.x_axis = RX_package[3];\n                RX_buffer.y_axis = RX_package[4];\n                RX_buffer.C_speed = RX_package[5] + 127;\n                RX_buffer.x_Base = RX_package[6];\n                RX_buffer.y_Arm = RX_package[7];\n            }\n            else\n            {\n                Serialcount++;\n                return;\n            }\n        }\n    }\n    else\n    {\n        delay(1);\n        Serialcount++;\n        if(Serialcount \u003e 500)\n        {\n            Serialcount = 0;\n            RX_buffer.mode1 = 0; \n            RX_buffer.mode2 = 0;\n            RX_buffer.x_axis = 0;\n            RX_buffer.y_axis = 0;\n            RX_buffer.x_Base = 0;\n            RX_buffer.y_Arm = 0;\n            Line_tracking_Function_flag = false;\n            Avoidance_Function_flag = false;\n            Following_Function_flag = false;\n            Jail_Function_flag = false;\n        }\n    }\n}\n"}}}Content-Length: 314

{"jsonrpc":"2.0","id":"2","method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server266849184/sketch/6_BlueTooth.ino.cpp"},"range":{"start":{"line":21,"character":29},"end":{"line":21,"character":29}},"context":{"diagnostics":[]}}}
<<<
Content-Length: 187

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server266849184/.clangd"}}Content-Length: 111

{"id":0,"jsonrpc":"2.0","method":"window/workDoneProgress/create","params":{"token":"backgroundIndexProgress"}}
>>>
Content-Length: 38

{"jsonrpc":"2.0","id":0,"result":null}
<<<
Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"begin","percentage":0,"title":"indexing"}}}Content-Length: 141

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/1","percentage":0}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/27","percentage":0}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/27","percentage":0}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/27","percentage":0}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/27","percentage":0}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"1/27","percentage":3}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"1/27","percentage":3}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"1/27","percentage":3}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"1/27","percentage":3}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"2/27","percentage":7}}}Content-Length: 142

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"2/27","percentage":7}}}Content-Length: 218

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server266849184/sketch/6_BlueTooth.ino.cpp","version":1}}Content-Length: 38

{"id":"2","jsonrpc":"2.0","result":[]}
>>>
Content-Length: 211

{"jsonrpc":"2.0","id":"3","method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server266849184/sketch/6_BlueTooth.ino.cpp"}}}
<<<
Content-Length: 16685

{"id":"3","jsonrpc":"2.0","result":[{"detail":"const int","kind":13,"name":"Trig","range":{"end":{"character":30,"line":14},"start":{"character":0,"line":14}},"selectionRange":{"end":{"character":14,"line":14},"start":{"character":10,"line":14}}},{"detail":"const int","kind":13,"name":"Echo","range":{"end":{"character":30,"line":15},"start":{"character":0,"line":15}},"selectionRange":{"end":{"character":14,"line":15},"start":{"character":10,"line":15}}},{"detail":"const int","kind":13,"name":"Forward","range":{"end":{"character":28,"line":25},"start":{"character":0,"line":25}},"selectionRange":{"end":{"character":17,"line":25},"start":{"character":10,"line":25}}},{"detail":"const int","kind":13,"name":"Backward","range":{"end":{"character":29,"line":26},"start":{"character":0,"line":26}},"selectionRange":{"end":{"character":18,"line":26},"start":{"character":10,"line":26}}},{"detail":"const int","kind":13,"name":"Turn_Left","range":{"end":{"character":29,"line":27},"start":{"character":0,"line":27}},"selectionRange":{"end":{"character":19,"line":27},"start":{"character":10,"line":27}}},{"detail":"const int","kind":13,"name":"Turn_Right","range":{"end":{"character":29,"line":28},"start":{"character":0,"line":28}},"selectionRange":{"end":{"character":20,"line":28},"start":{"character":10,"line":28}}},{"detail":"const int","kind":13,"name":"Top_Left","range":{"end":{"character":28,"line":29},"start":{"character":0,"line":29}},"selectionRange":{"end":{"character":18,"line":29},"start":{"character":10,"line":29}}},{"detail":"const int","kind":13,"name":"Bottom_Left","range":{"end":{"character":29,"line":30},"start":{"character":0,"line":30}},"selectionRange":{"end":{"character":21,"line":30},"start":{"character":10,"line":30}}},{"detail":"const int","kind":13,"name":"Top_Right","range":{"end":{"character":28,"line":31},"start":{"character":0,"line":31}},"selectionRange":{"end":{"character":19,"line":31},"start":{"character":10,"line":31}}},{"detail":"const int","kind":13,"name":"Bottom_Right","range":{"end":{"character":28,"line":32},"start":{"character":0,"line":32}},"selectionRange":{"end":{"character":22,"line":32},"start":{"character":10,"line":32}}},{"detail":"const int","kind":13,"name":"Stop","range":{"end":{"character":27,"line":33},"start":{"character":0,"line":33}},"selectionRange":{"end":{"character":14,"line":33},"start":{"character":10,"line":33}}},{"detail":"const int","kind":13,"name":"Contrarotate","range":{"end":{"character":29,"line":34},"start":{"character":0,"line":34}},"selectionRange":{"end":{"character":22,"line":34},"start":{"character":10,"line":34}}},{"detail":"const int","kind":13,"name":"Clockwise","range":{"end":{"character":28,"line":35},"start":{"character":0,"line":35}},"selectionRange":{"end":{"character":19,"line":35},"start":{"character":10,"line":35}}},{"detail":"byte[5]","kind":13,"name":"TX_package","range":{"end":{"character":42,"line":38},"start":{"character":0,"line":38}},"selectionRange":{"end":{"character":15,"line":38},"start":{"character":5,"line":38}}},{"detail":"byte[10]","kind":13,"name":"RX_package","range":{"end":{"character":25,"line":39},"start":{"character":0,"line":39}},"selectionRange":{"end":{"character":15,"line":39},"start":{"character":5,"line":39}}},{"detail":"int","kind":13,"name":"UT_distance","range":{"end":{"character":19,"line":40},"start":{"character":0,"line":40}},"selectionRange":{"end":{"character":15,"line":40},"start":{"character":4,"line":40}}},{"detail":"int","kind":13,"name":"Serialcount","range":{"end":{"character":19,"line":41},"start":{"character":0,"line":41}},"selectionRange":{"end":{"character":15,"line":41},"start":{"character":4,"line":41}}},{"detail":"int","kind":13,"name":"base_degrees","range":{"end":{"character":21,"line":42},"start":{"character":0,"line":42}},"selectionRange":{"end":{"character":16,"line":42},"start":{"character":4,"line":42}}},{"detail":"int","kind":13,"name":"arm_degrees","range":{"end":{"character":20,"line":43},"start":{"character":0,"line":43}},"selectionRange":{"end":{"character":15,"line":43},"start":{"character":4,"line":43}}},{"detail":"int","kind":13,"name":"claw_degrees","range":{"end":{"character":21,"line":44},"start":{"character":0,"line":44}},"selectionRange":{"end":{"character":16,"line":44},"start":{"character":4,"line":44}}},{"detail":"boolean","kind":13,"name":"menory_action_flag","range":{"end":{"character":26,"line":45},"start":{"character":0,"line":45}},"selectionRange":{"end":{"character":26,"line":45},"start":{"character":8,"line":45}}},{"detail":"boolean","kind":13,"name":"Line_tracking_Function_flag","range":{"end":{"character":43,"line":46},"start":{"character":0,"line":46}},"selectionRange":{"end":{"character":35,"line":46},"start":{"character":8,"line":46}}},{"detail":"boolean","kind":13,"name":"Avoidance_Function_flag","range":{"end":{"character":39,"line":47},"start":{"character":0,"line":47}},"selectionRange":{"end":{"character":31,"line":47},"start":{"character":8,"line":47}}},{"detail":"boolean","kind":13,"name":"Following_Function_flag","range":{"end":{"character":39,"line":48},"start":{"character":0,"line":48}},"selectionRange":{"end":{"character":31,"line":48},"start":{"character":8,"line":48}}},{"detail":"boolean","kind":13,"name":"Jail_Function_flag","range":{"end":{"character":34,"line":49},"start":{"character":0,"line":49}},"selectionRange":{"end":{"character":26,"line":49},"start":{"character":8,"line":49}}},{"detail":"int","kind":13,"name":"Left_Tra_Value","range":{"end":{"character":18,"line":50},"start":{"character":0,"line":50}},"selectionRange":{"end":{"character":18,"line":50},"start":{"character":4,"line":50}}},{"detail":"int","kind":13,"name":"Center_Tra_Value","range":{"end":{"character":20,"line":51},"start":{"character":0,"line":51}},"selectionRange":{"end":{"character":20,"line":51},"start":{"character":4,"line":51}}},{"detail":"int","kind":13,"name":"Right_Tra_Value","range":{"end":{"character":19,"line":52},"start":{"character":0,"line":52}},"selectionRange":{"end":{"character":19,"line":52},"start":{"character":4,"line":52}}},{"detail":"int","kind":13,"name":"Black_Line","range":{"end":{"character":20,"line":53},"start":{"character":0,"line":53}},"selectionRange":{"end":{"character":14,"line":53},"start":{"character":4,"line":53}}},{"detail":"int","kind":13,"name":"actions_count","range":{"end":{"character":21,"line":54},"start":{"character":0,"line":54}},"selectionRange":{"end":{"character":17,"line":54},"start":{"character":4,"line":54}}},{"detail":"int","kind":13,"name":"auto_count","range":{"end":{"character":14,"line":55},"start":{"character":0,"line":55}},"selectionRange":{"end":{"character":14,"line":55},"start":{"character":4,"line":55}}},{"detail":"int[20]","kind":13,"name":"claw_read_degress","range":{"end":{"character":37,"line":56},"start":{"character":0,"line":56}},"selectionRange":{"end":{"character":21,"line":56},"start":{"character":4,"line":56}}},{"detail":"int[20]","kind":13,"name":"arm_read_degress","range":{"end":{"character":36,"line":57},"start":{"character":0,"line":57}},"selectionRange":{"end":{"character":20,"line":57},"start":{"character":4,"line":57}}},{"detail":"int[20]","kind":13,"name":"base_read_degress","range":{"end":{"character":37,"line":58},"start":{"character":0,"line":58}},"selectionRange":{"end":{"character":21,"line":58},"start":{"character":4,"line":58}}},{"children":[{"detail":"byte","kind":8,"name":"mode1","range":{"end":{"character":14,"line":62},"start":{"character":4,"line":62}},"selectionRange":{"end":{"character":14,"line":62},"start":{"character":9,"line":62}}},{"detail":"byte","kind":8,"name":"mode2","range":{"end":{"character":14,"line":64},"start":{"character":4,"line":64}},"selectionRange":{"end":{"character":14,"line":64},"start":{"character":9,"line":64}}},{"detail":"char","kind":8,"name":"x_axis","range":{"end":{"character":19,"line":65},"start":{"character":4,"line":65}},"selectionRange":{"end":{"character":15,"line":65},"start":{"character":9,"line":65}}},{"detail":"char","kind":8,"name":"y_axis","range":{"end":{"character":19,"line":66},"start":{"character":4,"line":66}},"selectionRange":{"end":{"character":15,"line":66},"start":{"character":9,"line":66}}},{"detail":"byte","kind":8,"name":"C_speed","range":{"end":{"character":22,"line":67},"start":{"character":4,"line":67}},"selectionRange":{"end":{"character":16,"line":67},"start":{"character":9,"line":67}}},{"detail":"char","kind":8,"name":"x_Base","range":{"end":{"character":19,"line":68},"start":{"character":4,"line":68}},"selectionRange":{"end":{"character":15,"line":68},"start":{"character":9,"line":68}}},{"detail":"char","kind":8,"name":"y_Arm","range":{"end":{"character":18,"line":69},"start":{"character":4,"line":69}},"selectionRange":{"end":{"character":14,"line":69},"start":{"character":9,"line":69}}}],"detail":"struct","kind":23,"name":"(anonymous struct)","range":{"end":{"character":1,"line":70},"start":{"character":8,"line":60}},"selectionRange":{"end":{"character":14,"line":60},"start":{"character":8,"line":60}}},{"detail":"type alias","kind":5,"name":"rx_buffer","range":{"end":{"character":10,"line":70},"start":{"character":0,"line":60}},"selectionRange":{"end":{"character":10,"line":70},"start":{"character":1,"line":70}}},{"detail":"rx_buffer","kind":13,"name":"RX_buffer","range":{"end":{"character":19,"line":72},"start":{"character":0,"line":72}},"selectionRange":{"end":{"character":19,"line":72},"start":{"character":10,"line":72}}},{"detail":"Servo","kind":13,"name":"clawservo","range":{"end":{"character":15,"line":74},"start":{"character":0,"line":74}},"selectionRange":{"end":{"character":15,"line":74},"start":{"character":6,"line":74}}},{"detail":"Servo","kind":13,"name":"armservo","range":{"end":{"character":14,"line":75},"start":{"character":0,"line":75}},"selectionRange":{"end":{"character":14,"line":75},"start":{"character":6,"line":75}}},{"detail":"Servo","kind":13,"name":"baseservo","range":{"end":{"character":15,"line":76},"start":{"character":0,"line":76}},"selectionRange":{"end":{"character":15,"line":76},"start":{"character":6,"line":76}}},{"detail":"void ()","kind":12,"name":"Timer2Isr","range":{"end":{"character":16,"line":79},"start":{"character":0,"line":79}},"selectionRange":{"end":{"character":14,"line":79},"start":{"character":5,"line":79}}},{"detail":"void ()","kind":12,"name":"setup","range":{"end":{"character":12,"line":81},"start":{"character":0,"line":81}},"selectionRange":{"end":{"character":10,"line":81},"start":{"character":5,"line":81}}},{"detail":"void ()","kind":12,"name":"loop","range":{"end":{"character":11,"line":83},"start":{"character":0,"line":83}},"selectionRange":{"end":{"character":9,"line":83},"start":{"character":5,"line":83}}},{"detail":"void ()","kind":12,"name":"Line_tracking_Function","range":{"end":{"character":29,"line":85},"start":{"character":0,"line":85}},"selectionRange":{"end":{"character":27,"line":85},"start":{"character":5,"line":85}}},{"detail":"void ()","kind":12,"name":"Avoidance_Function","range":{"end":{"character":25,"line":87},"start":{"character":0,"line":87}},"selectionRange":{"end":{"character":23,"line":87},"start":{"character":5,"line":87}}},{"detail":"void ()","kind":12,"name":"Following_Function","range":{"end":{"character":25,"line":89},"start":{"character":0,"line":89}},"selectionRange":{"end":{"character":23,"line":89},"start":{"character":5,"line":89}}},{"detail":"void ()","kind":12,"name":"Jail_Function","range":{"end":{"character":20,"line":91},"start":{"character":0,"line":91}},"selectionRange":{"end":{"character":18,"line":91},"start":{"character":5,"line":91}}},{"detail":"void ()","kind":12,"name":"auto_doit","range":{"end":{"character":16,"line":93},"start":{"character":0,"line":93}},"selectionRange":{"end":{"character":14,"line":93},"start":{"character":5,"line":93}}},{"detail":"void ()","kind":12,"name":"free_mode","range":{"end":{"character":16,"line":95},"start":{"character":0,"line":95}},"selectionRange":{"end":{"character":14,"line":95},"start":{"character":5,"line":95}}},{"detail":"void ()","kind":12,"name":"read_degress","range":{"end":{"character":19,"line":97},"start":{"character":0,"line":97}},"selectionRange":{"end":{"character":17,"line":97},"start":{"character":5,"line":97}}},{"detail":"void ()","kind":12,"name":"auto_do","range":{"end":{"character":14,"line":99},"start":{"character":0,"line":99}},"selectionRange":{"end":{"character":12,"line":99},"start":{"character":5,"line":99}}},{"detail":"void (int, int)","kind":12,"name":"Motor","range":{"end":{"character":30,"line":101},"start":{"character":0,"line":101}},"selectionRange":{"end":{"character":10,"line":101},"start":{"character":5,"line":101}}},{"detail":"float (int, int)","kind":12,"name":"SR04","range":{"end":{"character":30,"line":103},"start":{"character":0,"line":103}},"selectionRange":{"end":{"character":10,"line":103},"start":{"character":6,"line":103}}},{"detail":"void (byte, byte)","kind":12,"name":"TX_Information","range":{"end":{"character":39,"line":105},"start":{"character":0,"line":105}},"selectionRange":{"end":{"character":19,"line":105},"start":{"character":5,"line":105}}},{"detail":"void ()","kind":12,"name":"RX_Information","range":{"end":{"character":25,"line":107},"start":{"character":0,"line":107}},"selectionRange":{"end":{"character":19,"line":107},"start":{"character":5,"line":107}}},{"detail":"void ()","kind":12,"name":"Timer2Isr","range":{"end":{"character":1,"line":113},"start":{"character":0,"line":109}},"selectionRange":{"end":{"character":14,"line":109},"start":{"character":5,"line":109}}},{"detail":"void ()","kind":12,"name":"setup","range":{"end":{"character":1,"line":147},"start":{"character":0,"line":114}},"selectionRange":{"end":{"character":10,"line":114},"start":{"character":5,"line":114}}},{"detail":"void ()","kind":12,"name":"loop","range":{"end":{"character":1,"line":184},"start":{"character":0,"line":149}},"selectionRange":{"end":{"character":9,"line":149},"start":{"character":5,"line":149}}},{"detail":"void ()","kind":12,"name":"Line_tracking_Function","range":{"end":{"character":1,"line":224},"start":{"character":0,"line":186}},"selectionRange":{"end":{"character":27,"line":186},"start":{"character":5,"line":186}}},{"detail":"void ()","kind":12,"name":"Avoidance_Function","range":{"end":{"character":1,"line":323},"start":{"character":0,"line":226}},"selectionRange":{"end":{"character":23,"line":226},"start":{"character":5,"line":226}}},{"detail":"void ()","kind":12,"name":"Following_Function","range":{"end":{"character":1,"line":356},"start":{"character":0,"line":325}},"selectionRange":{"end":{"character":23,"line":325},"start":{"character":5,"line":325}}},{"detail":"void ()","kind":12,"name":"Jail_Function","range":{"end":{"character":1,"line":506},"start":{"character":0,"line":358}},"selectionRange":{"end":{"character":18,"line":358},"start":{"character":5,"line":358}}},{"detail":"void ()","kind":12,"name":"auto_doit","range":{"end":{"character":1,"line":638},"start":{"character":0,"line":508}},"selectionRange":{"end":{"character":14,"line":508},"start":{"character":5,"line":508}}},{"detail":"void ()","kind":12,"name":"free_mode","range":{"end":{"character":1,"line":760},"start":{"character":0,"line":640}},"selectionRange":{"end":{"character":14,"line":640},"start":{"character":5,"line":640}}},{"detail":"void ()","kind":12,"name":"read_degress","range":{"end":{"character":1,"line":778},"start":{"character":0,"line":762}},"selectionRange":{"end":{"character":17,"line":762},"start":{"character":5,"line":762}}},{"detail":"void ()","kind":12,"name":"auto_do","range":{"end":{"character":1,"line":910},"start":{"character":0,"line":780}},"selectionRange":{"end":{"character":12,"line":780},"start":{"character":5,"line":780}}},{"detail":"void (int, int)","kind":12,"name":"Motor","range":{"end":{"character":1,"line":921},"start":{"character":0,"line":912}},"selectionRange":{"end":{"character":10,"line":912},"start":{"character":5,"line":912}}},{"detail":"float (int, int)","kind":12,"name":"SR04","range":{"end":{"character":1,"line":933},"start":{"character":0,"line":923}},"selectionRange":{"end":{"character":10,"line":923},"start":{"character":6,"line":923}}},{"detail":"void (byte, byte)","kind":12,"name":"TX_Information","range":{"end":{"character":1,"line":944},"start":{"character":0,"line":935}},"selectionRange":{"end":{"character":19,"line":935},"start":{"character":5,"line":935}}},{"detail":"void ()","kind":12,"name":"RX_Information","range":{"end":{"character":1,"line":990},"start":{"character":0,"line":946}},"selectionRange":{"end":{"character":19,"line":946},"start":{"character":5,"line":946}}}]}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"3/27","percentage":11}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"3/27","percentage":11}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"4/27","percentage":14}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"4/27","percentage":14}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"5/27","percentage":18}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"5/27","percentage":18}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"6/27","percentage":22}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"6/27","percentage":22}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"7/27","percentage":25}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"7/27","percentage":25}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"8/27","percentage":29}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"8/27","percentage":29}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"9/27","percentage":33}}}Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"9/27","percentage":33}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"10/27","percentage":37}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"10/27","percentage":37}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"11/27","percentage":40}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"11/27","percentage":40}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"12/27","percentage":44}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"12/27","percentage":44}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"13/27","percentage":48}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"13/27","percentage":48}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"14/27","percentage":51}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"14/27","percentage":51}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"15/27","percentage":55}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"15/27","percentage":55}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"16/27","percentage":59}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"16/27","percentage":59}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"17/27","percentage":62}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"17/27","percentage":62}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"18/27","percentage":66}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"18/27","percentage":66}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"19/27","percentage":70}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"19/27","percentage":70}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"20/27","percentage":74}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"20/27","percentage":74}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"21/27","percentage":77}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"21/27","percentage":77}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"22/27","percentage":81}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"23/27","percentage":85}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"24/27","percentage":88}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"25/27","percentage":92}}}Content-Length: 144

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"26/27","percentage":96}}}Content-Length: 107

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"end"}}}
>>>
Content-Length: 240

{"jsonrpc":"2.0","id":"4","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server266849184/sketch/6_BlueTooth.ino.cpp"},"position":{"line":32,"character":75}}}
<<<
Content-Length: 40

{"id":"4","jsonrpc":"2.0","result":null}
>>>
Content-Length: 240

{"jsonrpc":"2.0","id":"5","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server266849184/sketch/6_BlueTooth.ino.cpp"},"position":{"line":32,"character":75}}}
<<<
Content-Length: 40

{"id":"5","jsonrpc":"2.0","result":null}
>>>
Content-Length: 240

{"jsonrpc":"2.0","id":"6","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server266849184/sketch/6_BlueTooth.ino.cpp"},"position":{"line":31,"character":76}}}
<<<
Content-Length: 40

{"id":"6","jsonrpc":"2.0","result":null}
>>>
Content-Length: 240

{"jsonrpc":"2.0","id":"7","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server266849184/sketch/6_BlueTooth.ino.cpp"},"position":{"line":29,"character":47}}}
<<<
Content-Length: 40

{"id":"7","jsonrpc":"2.0","result":null}
>>>
Content-Length: 252

{"jsonrpc":"2.0","id":"8","method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server266849184/sketch/6_BlueTooth.ino.cpp"},"position":{"line":31,"character":81}}}
<<<
Content-Length: 38

{"id":"8","jsonrpc":"2.0","result":[]}
>>>
Content-Length: 314

{"jsonrpc":"2.0","id":"9","method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server266849184/sketch/6_BlueTooth.ino.cpp"},"range":{"start":{"line":31,"character":81},"end":{"line":31,"character":81}},"context":{"diagnostics":[]}}}
<<<
Content-Length: 38

{"id":"9","jsonrpc":"2.0","result":[]}
>>>
Content-Length: 195

{"jsonrpc":"2.0","method":"textDocument/didSave","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server266849184/sketch/6_BlueTooth.ino.cpp"}}}Content-Length: 39089

{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///C:/Users/Administrator/AppData/Local/Temp/arduino-language-server266849184/sketch/6_BlueTooth.ino.cpp","version":2},"contentChanges":[{"text":"#include \u003cArduino.h\u003e\n#line 1 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\n#include \u003cMsTimer2.h\u003e\n#include    \u003cServo.h\u003e\n\n// PWM control pin\n#define PWM1_PIN            5\n#define PWM2_PIN            6\n// 74HCT595N chip pin\n#define SHCP_PIN            2                               // The displacement of the clock\n#define EN_PIN              7                               // Can make control\n#define DATA_PIN            8                               // Serial data\n#define STCP_PIN            4                               // Memory register clock                  \n// Ultrasonic control pin\nconst int Trig       =      12;\nconst int Echo       =      13;\n// Trace the control pin\n#define LEFT_LINE_TRACJING      A0\n#define CENTER_LINE_TRACJING    A1\n#define right_LINE_TRACJING     A2\n// Servo control pin\n#define CLAW_PIN            9\n#define ARM_PIN             10\n#define BASE_PIN            11\n\nconst int Forward       = 92;                               // Forward\nconst int Backward      = 163;                              // Backward\nconst int Turn_Left     = 149;                              // Left translation\nconst int Turn_Right    = 106;                              // Right translation\nconst int Top_Left      = 20;                               // Upper left mobile\nconst int Bottom_Left   = 129;                              // Lower left mobile\nconst int Top_Right     = 72;                               // Upper right mobile\nconst int Bottom_Right  = 34;                               // The lower right move\nconst int Stop          = 0;                                // Stop\nconst int Contrarotate  = 172;                              // Counterclockwise rotation\nconst int Clockwise     = 83;                               // Rotate clockwise\n\n\nbyte TX_package[5] = {0xA5, 0, 0, 0, 0x5A};                 // Packet header(0xA5) +  original data (n*byte) + inspection sum(1byte) + Package the tail(0x5A)\nbyte RX_package[10] = {0};\nint UT_distance = 0;\nint Serialcount = 0;\nint base_degrees = 90;\nint arm_degrees = 90;\nint claw_degrees = 90;\nboolean menory_action_flag;\nboolean Line_tracking_Function_flag = false;\nboolean Avoidance_Function_flag = false;\nboolean Following_Function_flag = false;\nboolean Jail_Function_flag = false;\nint Left_Tra_Value;\nint Center_Tra_Value;\nint Right_Tra_Value;\nint Black_Line = 500;\nint actions_count = 0;\nint auto_count;\nint claw_read_degress[20] = {0, 0, 0};\nint arm_read_degress[20] = {0, 0, 0};\nint base_read_degress[20] = {0, 0, 0};\n\ntypedef struct \n{\n    byte mode1;             // Bit0: free mode;Bit1: tracking mode;Bit2: Obstacle avoidance mode;Bit3: Follow mode;\n                            // Bit4: Dungeon Mode;Bit5: Save button;Bit6: Automatic button;Bit7: empty\n    byte mode2;             // Bit0: fluke;Bit1: closed claw;Bit2: clockwise rotation;Bit3: reverse;\n    char x_axis = 0;        // Store variables on the X axis\n    char y_axis = 0;        // Store the variables on the Y axis\n    byte C_speed = 127;     // Speed of storage cart\n    char x_Base = 0;        // Store the steering gear on the X axis\n    char y_Arm = 0;         // Store the steering gear on the Y-axis\n}rx_buffer;\n\nrx_buffer RX_buffer;\n\nServo clawservo;\nServo armservo;\nServo baseservo;\n\n#line 77 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Timer2Isr();\n#line 82 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid setup();\n#line 117 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid loop();\n#line 154 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Line_tracking_Function();\n#line 194 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Avoidance_Function();\n#line 293 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Following_Function();\n#line 326 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Jail_Function();\n#line 476 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid auto_doit();\n#line 608 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid free_mode();\n#line 730 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid read_degress();\n#line 748 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid auto_do();\n#line 880 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Motor(int Dir, int Speed);\n#line 891 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nfloat SR04(int Trig, int Echo);\n#line 903 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid TX_Information(byte dis, byte act);\n#line 914 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid RX_Information(void);\n#line 77 \"E:\\\\5-教程\\\\1.tutorial\\\\ZYC0072机械手小车\\\\ZYC0072\\\\4. Tutorial_Arduino\\\\4_Arduino Code\\\\6_BlueTooth\\\\6_BlueTooth.ino\"\nvoid Timer2Isr()\n{\n    sei();\n    UT_distance = SR04(Trig, Echo);\n}\nvoid setup()\n{\n    pinMode(SHCP_PIN, OUTPUT);\n    pinMode(EN_PIN, OUTPUT);\n    pinMode(DATA_PIN, OUTPUT);\n    pinMode(STCP_PIN, OUTPUT);\n    pinMode(PWM1_PIN, OUTPUT);\n    pinMode(PWM2_PIN, OUTPUT);\n\n    pinMode(Trig, OUTPUT);\n    pinMode(Echo, INPUT);\n\n    pinMode(LEFT_LINE_TRACJING, INPUT);\n    pinMode(CENTER_LINE_TRACJING, INPUT);\n    pinMode(right_LINE_TRACJING, INPUT);\n\n    clawservo.attach(CLAW_PIN);\n    armservo.attach(ARM_PIN);\n    baseservo.attach(BASE_PIN);\n    clawservo.write(claw_degrees);\n    delay(500);\n    armservo.write(arm_degrees);\n    delay(500);\n    baseservo.write(base_degrees);\n    delay(500);\n\n    Motor(Stop, 0);\n\n    Serial.begin(9600);\n\n    //5ms timed interrupt Settings use timer2    \n    MsTimer2::set(100, Timer2Isr);\n    MsTimer2::start();\n}\n\nvoid loop()\n{\n    TX_Information(UT_distance, auto_count);                    // Send ultrasonic data\n    RX_Information();                                           // Receiving Bluetooth data\n    switch (RX_buffer.mode1)\n    {\n        case 0x02:       //tracking mode\n            Motor(Stop, 0);\n            Line_tracking_Function();\n            delay(10);\n            break;\n        case 0x04:       //Obstacle avoidance mode\n            Motor(Stop, 0);\n            Avoidance_Function();\n            delay(10);\n            break;\n        case 0x08:       //Follow the pattern\n            Motor(Stop, 0);\n            Following_Function();\n            delay(10);\n            break;\n        case 0x10:       //Dungeon mode\n            Motor(Stop, 0);\n            Jail_Function();\n            delay(10);\n            break;\n        case 0x40:       //Automatic mode\n            Motor(Stop, 0);\n            auto_doit();\n            delay(10);\n            break;\n        default:\n            free_mode();\n            break;\n    }\n}\n\nvoid Line_tracking_Function()       // tracking mode\n{\n    Line_tracking_Function_flag = true;\n    while (Line_tracking_Function_flag)\n    {\n        Left_Tra_Value = analogRead(LEFT_LINE_TRACJING);\n        Center_Tra_Value = analogRead(CENTER_LINE_TRACJING);\n        Right_Tra_Value = analogRead(right_LINE_TRACJING);\n        if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Forward, 175);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Contrarotate, 165);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Contrarotate, 190);\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Clockwise, 190);\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Clockwise, 165);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Stop, 0);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n        {\n            Line_tracking_Function_flag = false;\n        }\n    }\n}\n\nvoid Avoidance_Function()           // Obstacle avoidance mode\n{\n    int i;\n    Avoidance_Function_flag = true;\n    while (Avoidance_Function_flag)\n    {\n        if (UT_distance \u003c= 25)\n        {\n            if (UT_distance \u003c= 15)\n            {\n                Motor(Stop, 0);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 2; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Backward, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 12; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Clockwise, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 4; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                Motor(Stop, 0);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 2; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Backward, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 6; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n                Motor(Contrarotate, 180);\n                /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n                for(i = 0; i \u003c 12; i++)\n                {\n                    delay(50);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        Avoidance_Function_flag = false;\n                        return;\n                    }\n                }\n            }\n        }\n        else\n        {\n            Motor(Forward, 180);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n        {\n            Avoidance_Function_flag = false;\n        }\n    }\n}\n\nvoid Following_Function()           // Follow the pattern\n{\n    Following_Function_flag = true;\n    while (Following_Function_flag)\n    {\n        if (UT_distance \u003c 15)\n        {\n            Motor(Backward, 200);\n        }\n        else if (15 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 20)\n        {\n            Motor(Stop, 0);\n        }\n        else if (20 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 25)\n        {\n            Motor(Forward, 180);\n        }\n        else if (25 \u003c= UT_distance \u0026\u0026 UT_distance \u003c= 50)\n        {\n            Motor(Forward, 220);\n        }\n        else\n        {\n            Motor(Stop, 0);\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x10)\n        {\n            Following_Function_flag = false;\n        }\n    }\n}\n\nvoid Jail_Function()                // Dungeon mode\n{\n    int i;\n    Jail_Function_flag = true;\n    while (Jail_Function_flag)\n    {\n        Left_Tra_Value = analogRead(LEFT_LINE_TRACJING);\n        Center_Tra_Value = analogRead(CENTER_LINE_TRACJING);\n        Right_Tra_Value = analogRead(right_LINE_TRACJING);\n        if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Forward, 150);\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Backward,150);\n            /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003e= Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003c Black_Line)\n        {\n            Motor(Backward,150);\n             /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003c Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Backward,150);\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Contrarotate,160);\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else if (Left_Tra_Value \u003c Black_Line \u0026\u0026 Center_Tra_Value \u003e= Black_Line \u0026\u0026 Right_Tra_Value \u003e= Black_Line)\n        {\n            Motor(Backward,150);\n             /* 为了避免堵塞串口接收，延时不能太长，于是分步延时 */\n            for(i = 0; i \u003c 4; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Contrarotate,160);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        else\n        {\n            Motor(Backward,150);\n            for(i = 0; i \u003c 12; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n            Motor(Clockwise,160);\n            for(i = 0; i \u003c 10; i++)\n            {\n                delay(50);\n                RX_Information();\n                if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n                {\n                    Jail_Function_flag = false;\n                    return;\n                }\n            }\n        }\n        RX_Information();\n        if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08)\n        {\n            Jail_Function_flag = false;\n        }\n    }\n}\n\nvoid auto_doit()                      // Automatic mode\n{\n    if (0 != auto_count)\n    {\n        menory_action_flag = true;\n    }\n    actions_count = 0;\n    claw_degrees = clawservo.read();\n    arm_degrees = armservo.read();\n    base_degrees = baseservo.read();\n    while (menory_action_flag)\n    {\n        for (int i = (1); i \u003c= (auto_count); i = i + (1))\n        {\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n            {\n                while (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees + 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (claw_degrees \u003e claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees - 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n            {\n                while (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees + 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (arm_degrees \u003e arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees - 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (base_degrees \u003c base_read_degress[(int)(i - 1)])\n            {\n                while (base_degrees \u003c base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees + 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (base_degrees \u003e base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees - 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n        }\n    }\n}\n\nvoid free_mode()                    // free mode\n{\n    if(RX_buffer.x_axis \u003e= -30 \u0026\u0026 RX_buffer.x_axis \u003c= 30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Forward\n    {\n        Motor(Forward, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= -30 \u0026\u0026 RX_buffer.x_axis \u003c= 30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Backward\n    {\n        Motor(Backward, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_axis \u003e= -30 \u0026\u0026 RX_buffer.y_axis \u003c= 30 \u0026\u0026 RX_buffer.x_axis \u003c= -30)     //Turn_Left\n    {\n        Motor(Turn_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_axis \u003e= -30 \u0026\u0026 RX_buffer.y_axis \u003c= 30 \u0026\u0026 RX_buffer.x_axis \u003e= 30)     //Turn_Right\n    {\n        Motor(Turn_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003c= -30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Top_Left\n    {\n        Motor(Top_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003c= -30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Bottom_Left\n    {\n        Motor(Bottom_Left, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= 30 \u0026\u0026 RX_buffer.y_axis \u003e= 30)     //Top_Right\n    {\n        Motor(Top_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.x_axis \u003e= 30 \u0026\u0026 RX_buffer.y_axis \u003c= -30)     //Bottom_Right\n    {\n        Motor(Bottom_Right, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x04)     //Contrarotate\n    {\n        Motor(Contrarotate, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x08)     //Clockwise\n    {\n        Motor(Clockwise, RX_buffer.C_speed);\n        delay(5);\n    }\n    else if (RX_buffer.y_Arm \u003c= 30 \u0026\u0026 RX_buffer.y_Arm \u003e= -30 \u0026\u0026 RX_buffer.x_Base \u003c= -30)    // base_left\n    {\n        base_degrees = base_degrees + 1;\n        if (base_degrees \u003e= 185) \n        {\n            base_degrees = 185;\n        }\n        baseservo.write(base_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.y_Arm \u003c= 30 \u0026\u0026 RX_buffer.y_Arm \u003e= -30 \u0026\u0026 RX_buffer.x_Base \u003e= 30)     // base_right\n    {\n        base_degrees = base_degrees - 1;\n        if (base_degrees \u003c= 0) \n        {\n            base_degrees = 0;\n        }\n        baseservo.write(base_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.x_Base \u003c= 30 \u0026\u0026 RX_buffer.x_Base \u003e= -30 \u0026\u0026 RX_buffer.y_Arm \u003c= -30)    // Arm contraction\n    {\n        arm_degrees = arm_degrees - 1;\n        if (arm_degrees \u003c= 0) \n        {\n            arm_degrees = 0;\n        }\n        armservo.write(arm_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.x_Base \u003c= 30 \u0026\u0026 RX_buffer.x_Base \u003e= -30 \u0026\u0026 RX_buffer.y_Arm \u003e= 30)     // Arm elongation\n    {\n        arm_degrees = arm_degrees + 1;\n        if (arm_degrees \u003e= 150) \n        {\n            arm_degrees = 150;\n        }\n        armservo.write(arm_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x01)            // claws open                                        \n    {\n        claw_degrees = claw_degrees - 1;\n        if (claw_degrees \u003c= 50) \n        {\n            claw_degrees = 50;\n        }\n        clawservo.write(claw_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode2 \u0026 0x02)            // claws closed\n    {\n        claw_degrees = claw_degrees + 1;\n        if (claw_degrees \u003e= 150) \n        {\n            claw_degrees = 150;\n        }\n        clawservo.write(claw_degrees);\n        delay(5);\n    }\n    else if (RX_buffer.mode1 \u0026 0x20)            // save\n    {\n        read_degress();\n    }  \n    else\n    {\n        Motor(Stop, 0);\n    }\n}\n\nvoid read_degress()\n{\n    if (actions_count \u003c= 19)\n    {\n        claw_read_degress[(int)((actions_count + 1) - 1)] = clawservo.read();\n        delay(50);\n        RX_Information(); \n        arm_read_degress[(int)((actions_count + 1) - 1)] = armservo.read();\n        delay(50);\n        RX_Information(); \n        base_read_degress[(int)((actions_count + 1) - 1)] = baseservo.read();\n        delay(50);\n        RX_Information(); \n        actions_count = actions_count + 1;\n        auto_count = actions_count;\n    }\n}\n\nvoid auto_do()\n{\n    if (0 != auto_count)\n    {\n        menory_action_flag = true;\n    }\n    actions_count = 0;\n    claw_degrees = clawservo.read();\n    arm_degrees = armservo.read();\n    base_degrees = baseservo.read();\n    while (menory_action_flag)\n    {\n        for (int i = (1); i \u003c= (auto_count); i = i + (1))\n        {\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n            {\n                while (claw_degrees \u003c claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees + 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (claw_degrees \u003e claw_read_degress[(int)(i - 1)])\n                {\n                    claw_degrees = claw_degrees - 1;\n                    clawservo.write(claw_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n            {\n                while (arm_degrees \u003c arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees + 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (arm_degrees \u003e arm_read_degress[(int)(i - 1)])\n                {\n                    arm_degrees = arm_degrees - 1;\n                    armservo.write(arm_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n            if (base_degrees \u003c base_read_degress[(int)(i - 1)])\n            {\n                while (base_degrees \u003c base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees + 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            else\n            {\n                while (base_degrees \u003e base_read_degress[(int)(i - 1)])\n                {\n                    base_degrees = base_degrees - 1;\n                    baseservo.write(base_degrees);\n                    delay(15);\n                    RX_Information();\n                    if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n                    {\n                        menory_action_flag = false;\n                        return;\n                    }\n                }\n            }\n            RX_Information();\n            if(RX_buffer.mode1 == 0x01 || RX_buffer.mode1 == 0x02 || RX_buffer.mode1 == 0x04 || RX_buffer.mode1 == 0x08 || RX_buffer.mode1 == 0x10)\n            {\n                menory_action_flag = false;\n                return;\n            }\n        }\n    }\n}\n\nvoid Motor(int Dir, int Speed)      // Motor drive\n{\n    digitalWrite(EN_PIN, LOW);\n    analogWrite(PWM1_PIN, Speed);\n    analogWrite(PWM2_PIN, Speed);\n\n    digitalWrite(STCP_PIN, LOW);\n    shiftOut(DATA_PIN, SHCP_PIN, MSBFIRST, Dir);\n    digitalWrite(STCP_PIN, HIGH);\n}\n\nfloat SR04(int Trig, int Echo)      // Ultrasonic distance measurement\n{\n    digitalWrite(Trig, LOW);\n    delayMicroseconds(2);\n    digitalWrite(Trig, HIGH);\n    delayMicroseconds(10);\n    digitalWrite(Trig, LOW);\n    float distance = pulseIn(Echo, HIGH) / 58.00;\n    delay(10);\n    return distance;\n}\n\nvoid TX_Information(byte dis, byte act)     // Sending data packets\n{\n    int check;\n    if(dis\u003e127) dis = 127;\n    if(act\u003e127) act = 127;\n    TX_package[1] = dis;\n    TX_package[2] = act;\n    TX_package[3] = byte(dis + act);                        // The sum of inspection                              \n    Serial.write(TX_package, 5);                            // Sending data packets\n}\n\nvoid RX_Information(void)                   // Receiving data packet\n{\n    if(Serial.available() \u003e 0)\n    {\n        delay(1);                                           // delay 1MS\n        if(Serial.readBytes(RX_package, 10))\n        {\n            if (RX_package[0] == 0xA5 \u0026\u0026 RX_package[9] == 0x5A)     // The header and tail of the packet are verified\n            {\n                Serialcount = 0;\n                RX_buffer.mode1 = RX_package[1];\n                RX_buffer.mode2 = RX_package[2];\n                RX_buffer.x_axis = RX_package[3];\n                RX_buffer.y_axis = RX_package[4];\n                RX_buffer.C_speed = RX_package[5] + 127;\n                RX_buffer.x_Base = RX_package[6];\n                RX_buffer.y_Arm = RX_package[7];\n            }\n            else\n            {\n                Serialcount++;\n                return;\n            }\n        }\n    }\n    else\n    {\n        delay(1);\n        Serialcount++;\n        if(Serialcount \u003e 500)\n        {\n            Serialcount = 0;\n            RX_buffer.mode1 = 0; \n            RX_buffer.mode2 = 0;\n            RX_buffer.x_axis = 0;\n            RX_buffer.y_axis = 0;\n            RX_buffer.x_Base = 0;\n            RX_buffer.y_Arm = 0;\n            Line_tracking_Function_flag = false;\n            Avoidance_Function_flag = false;\n            Following_Function_flag = false;\n            Jail_Function_flag = false;\n        }\n    }\n}\n"}]}}
<<<
Content-Length: 111

{"id":1,"jsonrpc":"2.0","method":"window/workDoneProgress/create","params":{"token":"backgroundIndexProgress"}}
>>>
Content-Length: 38

{"jsonrpc":"2.0","id":1,"result":null}
<<<
Content-Length: 143

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"begin","percentage":0,"title":"indexing"}}}Content-Length: 141

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/1","percentage":0}}}Content-Length: 141

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/1","percentage":0}}}Content-Length: 107

{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"end"}}}
>>>
Content-Length: 61

{"jsonrpc":"2.0","id":"10","method":"shutdown","params":null}
<<<
Content-Length: 41

{"id":"10","jsonrpc":"2.0","result":null}
>>>
Content-Length: 47

{"jsonrpc":"2.0","method":"exit","params":null}