闪灯程序
static int led_run(lua_State *L)
{
GPIO_ToggleBits(LED3_GPIO_PORT, LED3_PIN);
delay(500);
return 1;
}
int main()
{
int i=0;
lua_State *L;
gpio_init();
sys_tick_init();
uart_init();
while(1)
{
L= luaL_newstate();
lua_pushcfunction(L,led_run);
lua_setglobal(L,"myled");
luaL_dostring(L,"myled();");
lua_close(L);
}
}
我要赚赏金打赏帖 |
|
|---|---|
| bsp_log:RTT分级日志封装被打赏¥16元 | |
| J-LinkRTT常用API函数讲解被打赏¥14元 | |
| 【S32K3学习整理】S32K388 四核启动被打赏¥23元 | |
| 【S32K3学习整理】Lockstep和Decoupled 模式被打赏¥28元 | |
| 嵌入式芯片调试神器-J-LinkRTT被打赏¥21元 | |
| 人体红外PIR感应传感器使用(ESP32S3)被打赏¥26元 | |
| 一种有效完成脚本程序测试的方法被打赏¥28元 | |
| WorkBuddy搭配SolidCraft给开发板做两件式外壳被打赏¥33元 | |
| 开箱一块k230被打赏¥33元 | |
| 【瑞萨RA8D1测评】RA8D1+lwIP网络验证与TCPOTA的实验记录被打赏¥33元 | |
我要赚赏金
