1.1. GPIO output - Lamp LED
This demo is based on the output mode of GPIO.
1.1.1. Hardware Connection
This demo is based on BL706_IOT and the connection method is as follows
GPIO function GPIO pin
----------------------------------
D0 <--> GPIO22
D1 <--> GPIO29
D2 <--> GPIO30
D3 <--> GPIO31
1.1.2. Software Implementation
See
examples/gpio/gpio_blink
for the software code
1gpio_set_mode(GPIO_PIN_22, GPIO_OUTPUT_PP_MODE);
2gpio_set_mode(GPIO_PIN_29, GPIO_OUTPUT_PP_MODE);
3gpio_set_mode(GPIO_PIN_30, GPIO_OUTPUT_PP_MODE);
4gpio_set_mode(GPIO_PIN_31, GPIO_OUTPUT_PP_MODE);
Use the above code to configure
GPIO22
GPIO29
GPIO30
GPIO31
to output pull-up mode.
1gpio_write(GPIO_PIN_22, 0);
Use the above code to modify the output level value.
1.1.3. Compile and Program
CDK compilation
Open project:gpio_blink.cdkproj
Refer to the steps of Guide to using CDK (like MDK Keil) under Windows to compile and download
Command compilation
1 $ cd <sdk_path>/bl_mcu_sdk
2 $ make BOARD=bl706_iot APP=gpio_blink
Program
1.1.4. Experimental Phenomena
Video display: