main_entry.c 366 B

1234567891011121314151617
  1. #include <stdio.h>
  2. #include "ohos_init.h"
  3. #include "iot_gpio.h"
  4. #include "iot_gpio_ex.h"
  5. // 请使用五角星扩展板
  6. #define LED 9
  7. void led_entry(){
  8. printf("led_entry called \n");
  9. IoTGpioInit(LED);
  10. IoTGpioSetDir(LED,IOT_GPIO_DIR_OUT);
  11. IoTGpioSetFunc(LED,IOT_GPIO_FUNC_GPIO_7_GPIO);
  12. IoTGpioSetOutputVal(LED,1);
  13. }
  14. APP_FEATURE_INIT(led_entry);