Library Search
结果页

主循环

在 元器件 / 技术栈 / 知识库 中找到 16 个匹配结果。

返回文档库
元器件

元器件

1 个
查看全部
技术栈

技术栈

7 个
查看全部
知识库

知识库

8 个
Shell 脚本实战——服务器监控工具 mem}% CMD=${cmd:0:50}" done } # ── 主循环 ── main() { log "======== 监控开始 ========" local cpu cpu=$(check_cpu) log "CPU 使用率: ${cpu}%" if [ "$cpu" -ge "$ALERT_CPU" ]; then… 2% 主循环 int Module4G_Reset(void) { LOG("Resetting module..."); if (g_device.mqtt_connected) { MQTT_Disconnect(); g_device.mqtt_connected = false; } AT_SendCmd("AT+CFUN=0", at_r… 2% 01-hello-world-基础语法 # while 循环 count = 0 while count < 3: print(f" while count = {count}") count += 1 # ===== 5. 函数 ===== def greet(user: str, greeting: str = "Hello") -> str: """返回问候语(带类型注解)""" return… 2% PWM可调灯珠模块(三针) — 代码例程 HAL_Delay(stepDelayMs); } } // 在主循环中调用 // while(1) { LED_Breathe(3); HAL_Delay(200); } ``` --- ## 示例 4:MicroPython (ESP32) ```python """ PWM灯珠模块 — ESP32 MicroPython SIG → GPIO25, VCC → 3.3V… 2% MN316 NB-IoT驱动代码 — STM32 UART+DMA+IDLE · MQTT物模型上报 lay(1000); } } /* ---- 主循环: 周期上报 ---- */ uint32_t last_upload = 0; while (1) { uint32_t now = HAL_GetTick(); if (now - last_upload >= NBIOT_UPLOAD_INTERVAL_M… 1% MPU6500 驱动代码例程 - I2C通信(Arduino & ESP-IDF) esp_err_t mpu6500_read_data(mpu6500_data_t *data) { uint8_t buf[14]; esp_err_t ret = mpu6500_read_regs(REG_ACCEL_XOUT_H, buf, 14); if (ret != ESP_OK) return ret; int16_t ax = (buf… 1% GPIO 流水灯与按键控制 - 1) : (active_led - 1); } } /* ── 主循环 ── */ int main(void) { HAL_Init(); SystemClock_Config(); // CubeMX 生成 MX_GPIO_Init(); // CubeMX 生成 MX_TIM2_Init();… 1% INMP441 I2S 麦克风 — 代码例程 (ESP32 + STM32) /* -------- DMA 半满/全满中断回调 -------- */ void HAL_I2S_RxHalfCpltCallback(I2S_HandleTypeDef *hi2s) { // 前半缓冲区就绪 (audioBuffer[0..BUFFER_SIZE/2-1]) // 可在此处理或置标志位 bufferReady = 1; } void HAL_I2S… 1%