{
    "ok": true,
    "data": {
        "title": "K-0502",
        "rev_id": 12935,
        "updated_at": "2023-04-18T06:30:05+00:00",
        "chunk_count": 37,
        "chunks": [
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "",
                "chunk_index": 0,
                "content": "# K-0502",
                "char_count": 8,
                "token_estimate": 2
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "ABS Holder Kit for RPi & Arduino",
                "chunk_index": 1,
                "content": "<figure>\n<img src=\"GPIO_20.jpg\" title=\"GPIO_20.jpg\" width=\"300\" alt=\"GPIO_20.jpg\" \/>\n<figcaption aria-hidden=\"true\">GPIO_20.jpg<\/figcaption>\n<\/figure>\n\n-   Purchase URL \\[ <https:\/\/52pi.com\/products\/52pi-abs-experiment-holder-platform-diy-kit> \\]",
                "char_count": 246,
                "token_estimate": 62
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Description",
                "chunk_index": 2,
                "content": "This is a Raspberry Pi experimental tray kit for raspberry beginners or Arduino beginners.\nIt contains a long breadboard and a breadboard power supply that provides 3.3v and 5v power to the breadboard power rails.\nIt is easy to deploy electronic components and the Raspberry Pi or Arduino development board can be fixed on the tray.\nIt is convenient to carry out and can protect the device well, prevent short circuit and so on.\nIt can also prevent the jump wire from loosening during the movement.\nFit for circuit experiments with Raspberry Pi and Arduino Uno\/Mega 2560.",
                "char_count": 571,
                "token_estimate": 143
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Features",
                "chunk_index": 3,
                "content": "-   Easy to assemble\n-   ABS Material with screw holes\n-   Long breadboard\n-   Starter kits for the electronic experiments\n-   Compatibles with Raspberry Pi and Arduino Uno\/mega 2560\n-   Breadboard power supply (Offer 3.3V and 5V)\n-   Two Colors: Blue & Green",
                "char_count": 259,
                "token_estimate": 65
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Gallery",
                "chunk_index": 4,
                "content": "|                                             |                                             |                                             |\n|---------------------------------------------|---------------------------------------------|---------------------------------------------|\n| [320px \\|left](File:GPIO_19.jpg \"wikilink\") | [320px \\|left](File:GPIO_20.jpg \"wikilink\") | [320px \\|left](File:GPIO_21.jpg \"wikilink\") |",
                "char_count": 419,
                "token_estimate": 105
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Package Includes",
                "chunk_index": 5,
                "content": "-   1 x ABS Holder Kit For RPi & Arduino(experimental tray kit)\n-   1 x Long breadboard\n-   1 x Breadboard power supply(6.5-12V DC Input，5V\/3.3V Output)\n-   5 x Red LED\n-   5 x Blue LED\n-   5 x White LED\n-   5 x Yellow LED\n-   5 x Green LED\n-   2 x RGB LED\n-   2 x Button\n-   1 x Buzzer\n-   10 x 1KΩ Resister\n-   2 x Acrylic washer\n-   40 x Male-to-Female jump wire\n-   40 x Male-to-Male jump wire\n-   15 x Screw\n-   1 x Anti-slipper pad\n-   1 x Screw driver\n\n[500px \\|left](File:GPIO_19.jpg \"wikilink\")",
                "char_count": 503,
                "token_estimate": 126
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Applications",
                "chunk_index": 6,
                "content": "|                                                                          |                                                                          |                                                                          |\n|--------------------------------------------------------------------------|--------------------------------------------------------------------------|--------------------------------------------------------------------------|\n| <figure>\n <img src=\"GPIO_1.jpg\" title=\"GPIO_1.jpg\" width=\"320\" alt=\"GPIO_1.jpg\" \/>\n <figcaption aria-hidden=\"true\">GPIO_1.jpg<\/figcaption>\n <\/figure>                                                                 | <figure>\n                                                                            <img src=\"GPIO_2.jpg\" title=\"GPIO_2.jpg\" width=\"320\" alt=\"GPIO_2.jpg\" \/>\n                                                                            <figcaption aria-hidden=\"true\">GPIO_2.jpg<\/figcaption>\n                                                                            <\/figure>                                                                 | <figure>",
                "char_count": 1121,
                "token_estimate": 281
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Applications",
                "chunk_index": 7,
                "content": "<img src=\"GPIO_7.jpg\" title=\"GPIO_7.jpg\" width=\"320\" alt=\"GPIO_7.jpg\" \/>\n                                                                                                                                                       <figcaption aria-hidden=\"true\">GPIO_7.jpg<\/figcaption>\n                                                                                                                                                       <\/figure>                                                                 |",
                "char_count": 505,
                "token_estimate": 127
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Applications",
                "chunk_index": 8,
                "content": "|                                                                          |                                                                          |                                                                             |\n|--------------------------------------------------------------------------|--------------------------------------------------------------------------|-----------------------------------------------------------------------------|\n| <figure>\n <img src=\"GPIO_8.jpg\" title=\"GPIO_8.jpg\" width=\"320\" alt=\"GPIO_8.jpg\" \/>\n <figcaption aria-hidden=\"true\">GPIO_8.jpg<\/figcaption>\n <\/figure>                                                                 | <figure>\n                                                                            <img src=\"GPIO_9.jpg\" title=\"GPIO_9.jpg\" width=\"320\" alt=\"GPIO_9.jpg\" \/>\n                                                                            <figcaption aria-hidden=\"true\">GPIO_9.jpg<\/figcaption>\n                                                                            <\/figure>                                                                 | <figure>",
                "char_count": 1127,
                "token_estimate": 282
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Applications",
                "chunk_index": 9,
                "content": "<img src=\"GPIO_10.jpg\" title=\"GPIO_10.jpg\" width=\"320\" alt=\"GPIO_10.jpg\" \/>\n                                                                                                                                                       <figcaption aria-hidden=\"true\">GPIO_10.jpg<\/figcaption>\n                                                                                                                                                       <\/figure>                                                                    |",
                "char_count": 512,
                "token_estimate": 128
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Applications",
                "chunk_index": 10,
                "content": "|                                                                             |                                                                             |                                                                             |\n|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------|\n| <figure>\n <img src=\"GPIO_11.jpg\" title=\"GPIO_11.jpg\" width=\"320\" alt=\"GPIO_11.jpg\" \/>\n <figcaption aria-hidden=\"true\">GPIO_11.jpg<\/figcaption>\n <\/figure>                                                                    | <figure>\n                                                                               <img src=\"GPIO_12.jpg\" title=\"GPIO_12.jpg\" width=\"320\" alt=\"GPIO_12.jpg\" \/>\n                                                                               <figcaption aria-hidden=\"true\">GPIO_12.jpg<\/figcaption>\n                                                                               <\/figure>                                                                    | <figure>",
                "char_count": 1162,
                "token_estimate": 291
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Applications",
                "chunk_index": 11,
                "content": "<img src=\"GPIO_14.jpg\" title=\"GPIO_14.jpg\" width=\"320\" alt=\"GPIO_14.jpg\" \/>\n                                                                                                                                                             <figcaption aria-hidden=\"true\">GPIO_14.jpg<\/figcaption>\n                                                                                                                                                             <\/figure>                                                                    |",
                "char_count": 524,
                "token_estimate": 131
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Applications",
                "chunk_index": 12,
                "content": "|                                                                             |                                                                             |                                                                             |\n|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------|\n| <figure>\n <img src=\"GPIO_13.jpg\" title=\"GPIO_13.jpg\" width=\"320\" alt=\"GPIO_13.jpg\" \/>\n <figcaption aria-hidden=\"true\">GPIO_13.jpg<\/figcaption>\n <\/figure>                                                                    | <figure>\n                                                                               <img src=\"GPIO_15.jpg\" title=\"GPIO_15.jpg\" width=\"320\" alt=\"GPIO_15.jpg\" \/>\n                                                                               <figcaption aria-hidden=\"true\">GPIO_15.jpg<\/figcaption>\n                                                                               <\/figure>                                                                    | <figure>",
                "char_count": 1162,
                "token_estimate": 291
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Applications",
                "chunk_index": 13,
                "content": "<img src=\"GPIO_18.jpg\" title=\"GPIO_18.jpg\" width=\"320\" alt=\"GPIO_18.jpg\" \/>\n                                                                                                                                                             <figcaption aria-hidden=\"true\">GPIO_18.jpg<\/figcaption>\n                                                                                                                                                             <\/figure>                                                                    |",
                "char_count": 524,
                "token_estimate": 131
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Documentations > Lesson 1 Blinking LED",
                "chunk_index": 14,
                "content": "-   Steps:\n    -   1\\. Download the latest image file(Raspbian) from: <https:\/\/www.raspberrypi.org\/downloads\/>\n    -   2\\. Unzip it and flash it to TF card by using Etcher tool or win32_diskimager tool.\n    -   3\\. Remove old version of wiringPi software and download and install the latest wiringPi software:\n\n<!-- -->\n\nsudo apt -y purge wiringpi\n    hash -r\n    cd \/tmp\n    wget https:\/\/project-downloads.drogon.net\/wiringpi-latest.deb\n    sudo dpkg -i wiringpi-latest.deb\n    gpio readall\n    gpio -v\n\n-   -   4\\. Connect LED and 220Ω Resister to breadboard and connect LED to Raspberry Pi's GPIO on Pin number 12 as following picture:",
                "char_count": 638,
                "token_estimate": 160
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Documentations > Lesson 1 Blinking LED",
                "chunk_index": 15,
                "content": "|                                                                                                        |                                                                                |\n|--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| <figure>\n <img src=\"Blinking_circuit.jpg\" title=\"Blinking_circuit.jpg\" width=\"500\" alt=\"Blinking_circuit.jpg\" \/>\n <figcaption aria-hidden=\"true\">Blinking_circuit.jpg<\/figcaption>\n <\/figure>                                                                                               | <figure>\n                                                                                                          <img src=\"Blinking.jpg\" title=\"Blinking.jpg\" width=\"500\" alt=\"Blinking.jpg\" \/>\n                                                                                                          <figcaption aria-hidden=\"true\">Blinking.jpg<\/figcaption>",
                "char_count": 1020,
                "token_estimate": 255
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Documentations > Lesson 1 Blinking LED",
                "chunk_index": 16,
                "content": "<\/figure>                                                                       |",
                "char_count": 81,
                "token_estimate": 21
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Documentations > Lesson 1 Blinking LED",
                "chunk_index": 17,
                "content": "-   -   5\\. Create a file with code as following:\n        -   Programming in Language C:\n\nCreate a file named led.c and paste following code:\n\n#include <stdio.h>\n    #include <wiringPi.h>\n\n\/\/define the led macro value.  1 means wiringPi name style, you should connect led positive pin to physical pin 12.\n    int LED = 1;\n    \/\/ main function\n    int main(void)\n    {\n            \/\/ initialized environment\n            \/\/ infinity loops\n            wiringPiSetup();\n            pinMode(LED, OUTPUT);\n    \/\/Loops\n            for(;;)\n            {\n                    digitalWrite(LED,HIGH);  \/\/Turn on led\n                    delay(20);\n                    digitalWrite(LED,LOW);   \/\/Turn off led\n                    delay(20);\n            }\n            return 0;\n    }\n\nCompile and run it:\n\ngcc -o led  -lwiringPi led.c\n    .\/led\n\n-   -   Programming in Python:\n\n1.Install RPi.GPIO:\n\npip3 install RPi.GPIO\n\n2\\. Create a file named blink_led.py and paste following code:\n\n#!\/usr\/bin\/env python3\n    import RPi.GPIO as GPIO    # Import Raspberry Pi GPIO library\n\nfrom time import sleep     # Import the sleep function from the time module\n\nLED = 18 # Define led pin's name (BCM naming style)",
                "char_count": 1189,
                "token_estimate": 298
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Documentations > Lesson 1 Blinking LED",
                "chunk_index": 18,
                "content": "GPIO.setwarnings(False)    # Ignore warning for now\n\nGPIO.setmode(GPIO.BCM)   # Use physical pin numbering\n\nGPIO.setup(LED, GPIO.OUT, initial=GPIO.LOW)   # Set pin 18 to be an output pin and set initial value to low (off)\n\nwhile True: # Run forever\n\nGPIO.output(LED, GPIO.HIGH) # Turn on\n\nsleep(1)                  # Sleep for 1 second\n\nGPIO.output(LED, GPIO.LOW)  # Turn off\n\nsleep(1)                  # Sleep for 1 second\n\n3.Run the code:\n\npython3 blink_led.py",
                "char_count": 462,
                "token_estimate": 116
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Documentations > Lesson 2 RGB LED Shifting",
                "chunk_index": 19,
                "content": "-   Component and pin definitions\n\n|                                                                                      |                                                                             |\n|--------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|\n| <figure>\n <img src=\"2019RGBled.jpg\" title=\"2019RGBled.jpg\" width=\"500\" alt=\"2019RGBled.jpg\" \/>\n <figcaption aria-hidden=\"true\">2019RGBled.jpg<\/figcaption>\n <\/figure>                                                                             | <figure>\n                                                                                        <img src=\"RGBDESC.jpg\" title=\"RGBDESC.jpg\" width=\"500\" alt=\"RGBDESC.jpg\" \/>\n                                                                                        <figcaption aria-hidden=\"true\">RGBDESC.jpg<\/figcaption>\n                                                                                        <\/figure>                                                                    |\n\n-   Connection Details\n\n[left\\|500px](File:RGBLED.jpg \"wikilink\")\n\\* Demo status",
                "char_count": 1180,
                "token_estimate": 295
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Documentations > Lesson 2 RGB LED Shifting",
                "chunk_index": 20,
                "content": "|                                                       |                                                     |                                                     |\n|-------------------------------------------------------|-----------------------------------------------------|-----------------------------------------------------|\n| ![ left \\| 320px](20191029165149.jpg \" left | 320px\") | ![ none \\|320px](20191029165211.jpg \" none |320px\") | ![ none \\|320px](20191029165203.jpg \" none |320px\") |\n\n-   Demo code\n\n<!-- -->\n\n\/\/ header files\n    #include <stdio.h>\n    #include <wiringPi.h>\n\nint LED[3]= {0,1,2};  \/\/ define an array to store leds pin, 0 - blue led, 1 - green led, 2 - red led.\n    int x = 200;      \/\/ interval for the delay.",
                "char_count": 740,
                "token_estimate": 185
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Documentations > Lesson 2 RGB LED Shifting",
                "chunk_index": 21,
                "content": "int main(void)\n    {\n            wiringPiSetup();   \/\/initialized wiringPi.\n            for(int i=0; i<3; i++)\n            {\n                    pinMode(LED[i], OUTPUT);      \/\/ set direction of the LED pin to output.\n                    digitalWrite(LED[i], HIGH);   \/\/ turn off all leds.\n            }\n            for(;;)\n            {\n                    for(int i=0; i<3; i++)\n                    {\n                            if(i==0)\n                            {\n                            digitalWrite(LED[i],LOW);    \/\/turn on blue led\n                            digitalWrite(LED[i+1],HIGH); \/\/turn off green led\n                            digitalWrite(LED[i+2],HIGH); \/\/turn off red led\n                            delay(x);\n                            }\n                            if(i==1)\n                            {\n                            digitalWrite(LED[i],LOW);   \/\/turn on green led\n                            digitalWrite(LED[i-1],HIGH); \/\/turn off blue led\n                            digitalWrite(LED[i+1],HIGH);  \/\/turn off red led\n                            delay(x);\n                            }\n                            if(i==2)\n                            {",
                "char_count": 1199,
                "token_estimate": 300
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Documentations > Lesson 2 RGB LED Shifting",
                "chunk_index": 22,
                "content": "digitalWrite(LED[i],LOW);     \/\/turn on red led\n                            digitalWrite(LED[i-1],HIGH);  \/\/turn off green led\n                            digitalWrite(LED[i-2],HIGH);  \/\/turn off blue led\n                            delay(x);\n                            }\n                    }\n            }\n            return 0;\n    }",
                "char_count": 336,
                "token_estimate": 84
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Documentations > Lesson 2 RGB LED Shifting",
                "chunk_index": 23,
                "content": "-   -   Compile the code with gcc tool and run:\n\n<!-- -->\n\ngcc -o rgbled -lwiringPi rgbled.c\n    .\/rgbled",
                "char_count": 105,
                "token_estimate": 27
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Documentations > Lesson 3 Buzzer",
                "chunk_index": 24,
                "content": "-   Build circuit\n\n<img src=\"AR0167_Buzzer_Activo_1.jpg\" title=\"AR0167_Buzzer_Activo_1.jpg\" width=\"500\" alt=\"AR0167_Buzzer_Activo_1.jpg\" \/>\n\\* Connect the long pin of the buzzer to 3V3 pin on Raspberry Pi and short pin to GPIO.2\n\n|                                             |                                                 |\n|---------------------------------------------|-------------------------------------------------|\n| [ right\\|500px](File:Buzzer.jpg \"wikilink\") | [left\\|500px](File:Pi4Buzzer001.jpg \"wikilink\") |\n\n-   -   Demo code\n\n<!-- -->\n\n#include <stdio.h>\n    #include <wiringPi.h>\n\n#define buzzer 0   \/\/ gpio.0 Equal BCM Pin 17\n    int interval = 0;",
                "char_count": 667,
                "token_estimate": 167
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Documentations > Lesson 3 Buzzer",
                "chunk_index": 25,
                "content": "int main(void)\n    {\n            wiringPiSetup();\n            pinMode(buzzer, OUTPUT);\n            digitalWrite(buzzer, LOW);\n            for(;;)\n            {\n                    for(interval=0; interval<=50; interval+=2)\n                    {\n                    digitalWrite(buzzer,HIGH);\n                    delay(interval);\n                    digitalWrite(buzzer,LOW);\n                    delay(interval);\n                    }\n                    for(interval=50; interval>=0; interval-=2)\n                    {\n                    digitalWrite(buzzer,HIGH);\n                    delay(interval);\n                    digitalWrite(buzzer,LOW);\n                    delay(interval);\n                    }\n            }\n            return 0;\n    }\n\n-   -   Compile it and run:\n\n<!-- -->\n\ngcc -o buzzer -lwiringPi buzzer.c\n    .\/buzzer",
                "char_count": 836,
                "token_estimate": 209
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Lesson 4 Morse Code",
                "chunk_index": 26,
                "content": "Morse code device will help childs to learn morse code: <img src=\"1200px-International_Morse_Code-fr.svg.png\" title=\"1200px-International_Morse_Code-fr.svg.png\" width=\"500\" alt=\"1200px-International_Morse_Code-fr.svg.png\" \/>\n\\* Build circuit",
                "char_count": 241,
                "token_estimate": 61
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Lesson 4 Morse Code",
                "chunk_index": 27,
                "content": "|                                                                                   |                                                                                               |\n|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|\n| <figure>\n <img src=\"Morsecode.jpg\" title=\"Morsecode.jpg\" width=\"500\" alt=\"Morsecode.jpg\" \/>\n <figcaption aria-hidden=\"true\">Morsecode.jpg<\/figcaption>\n <\/figure>                                                                          | <figure>\n                                                                                     <img src=\"Morsecodemech.jpg\" title=\"Morsecodemech.jpg\" width=\"500\" alt=\"Morsecodemech.jpg\" \/>\n                                                                                     <figcaption aria-hidden=\"true\">Morsecodemech.jpg<\/figcaption>\n                                                                                     <\/figure>                                                                                      |\n\n-   Write the code\n\n<!-- -->\n\n#include <stdio.h>\n    #include <wiringPi.h>",
                "char_count": 1195,
                "token_estimate": 299
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Lesson 4 Morse Code",
                "chunk_index": 28,
                "content": "#define LED 1\n    #define BUTTON 0\n    int x = 200;\n\nint main(void)\n    {\n            wiringPiSetup();    \/\/initialized\n            pinMode(LED, OUTPUT);   \/\/ set direction of the led pin.\n            digitalWrite(LED, LOW);  \/\/ turn off led\n            pinMode(BUTTON, INPUT);  \/\/ set direction of button pin as input pin\n            for(;;)\n            {\n                    if(digitalRead(BUTTON) == 0)    \/\/ read Button's status\n                    {\n                       delay(15);      \/\/ bounce time\n                       if(digitalRead(BUTTON) == 0)\n                       {\n                            digitalWrite(LED,LOW);    \/\/ led pin's status will turn on the buzzer and led.\n                       }\n                       else\n                       {\n                            digitalWrite(LED,HIGH);   \/\/ turn off.\n                       }\n                     }\n            }\n            return 0;\n    }\n\n-   Compile and run it\n\n<!-- -->\n\ngcc -o morsecode  -lwiringPi morsecde.c\n    .\/morsecode",
                "char_count": 1018,
                "token_estimate": 255
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Lesson 5 Button Control",
                "chunk_index": 29,
                "content": "This lesson will show you how to control each LED of a RGB LED by using a push button.\n\n-   Build Circuit",
                "char_count": 105,
                "token_estimate": 27
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Lesson 5 Button Control",
                "chunk_index": 30,
                "content": "|                                                                                               |                                                                                                           |\n|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|\n| <figure>\n <img src=\"Buttoncontrol.jpg\" title=\"Buttoncontrol.jpg\" width=\"500\" alt=\"Buttoncontrol.jpg\" \/>\n <figcaption aria-hidden=\"true\">Buttoncontrol.jpg<\/figcaption>\n <\/figure>                                                                                      | <figure>\n                                                                                                 <img src=\"Buttoncontrolreal.jpg\" title=\"Buttoncontrolreal.jpg\" width=\"500\" alt=\"Buttoncontrolreal.jpg\" \/>\n                                                                                                 <figcaption aria-hidden=\"true\">Buttoncontrolreal.jpg<\/figcaption>",
                "char_count": 1053,
                "token_estimate": 264
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Lesson 5 Button Control",
                "chunk_index": 31,
                "content": "<\/figure>                                                                                                  |",
                "char_count": 108,
                "token_estimate": 27
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Lesson 5 Button Control",
                "chunk_index": 32,
                "content": "-   Write code\n\n<!-- -->\n\n#include <stdio.h>\n    #include <wiringPi.h>\n\n#define button 29\n    int LED[3]= {0,1,2};\n    int x = 200;\n    int press_times = 0;",
                "char_count": 156,
                "token_estimate": 39
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Lesson 5 Button Control",
                "chunk_index": 33,
                "content": "int main(void)\n    {\n            wiringPiSetup();\n            for(int i=0; i<3; i++)\n            {\n                    pinMode(LED[i], OUTPUT);\n                    digitalWrite(LED[i], HIGH);\n                    pinMode(button, INPUT);\n            }\n            for(;;)\n            {\n                    if(digitalRead(button) == 0)\n                    {\n                            delay(15);\n                            if(digitalRead(button) == 0)\n                            {\n                                    if(press_times > 3)\n                                    {\n                                            press_times = 0;\n                                    }\n                            }\n                            switch(press_times)\n                            {\n                                    case 1:\n                                    {\n                                            printf(\"Press 1 time, turn on blue led.\\n\");\n                                            digitalWrite(LED[0],LOW);\n                                            digitalWrite(LED[1],HIGH);\n                                            digitalWrite(LED[2],HIGH);",
                "char_count": 1164,
                "token_estimate": 291
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Lesson 5 Button Control",
                "chunk_index": 34,
                "content": "delay(x);\n                                            break;\n                                    }\n                                    case 2:\n                                    {\n                                            printf(\"Press 2 times, turn on green led.\\n\");\n                                            digitalWrite(LED[0],HIGH);\n                                            digitalWrite(LED[1],LOW);\n                                            digitalWrite(LED[2],HIGH);\n                                            delay(x);\n                                            break;\n                                    }\n                                    case 3:\n                                    {\n                                            printf(\"Press 1 time, turn on red led.\\n\");\n                                            digitalWrite(LED[0],HIGH);\n                                            digitalWrite(LED[1],HIGH);\n                                            digitalWrite(LED[2],LOW);\n                                            delay(x);\n                                            break;\n                                    }",
                "char_count": 1151,
                "token_estimate": 288
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Lesson 5 Button Control",
                "chunk_index": 35,
                "content": "}\n                            press_times++;\n                    }\n            }\n            return 0;\n    }\n\n-   Compile and run it.\n\n<!-- -->\n\ngcc -o buttoncontrol -lwiringPi buttoncontrol.c\n    .\/buttoncontrol\n\nand then you will see the color change if you press button.",
                "char_count": 273,
                "token_estimate": 69
            },
            {
                "title": "K-0502",
                "rev_id": 12935,
                "heading_path": "Documentations",
                "chunk_index": 36,
                "content": "-   Download URL: \\[ <https:\/\/wiki.52pi.com\/images\/9\/95\/ABS_Experiment_Platform_Kits_Tutorial_Guide_In_Python.pdf> \\]",
                "char_count": 117,
                "token_estimate": 30
            }
        ]
    }
}