File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
examples/RegisterFunction Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change 3
3
LuaWrapper lua;
4
4
5
5
static int myFunction (lua_State *lua_state) {
6
+ (void *)lua_state;
6
7
Serial.println (" Hi from my C function" );
8
+ return 0 ;
7
9
}
8
10
9
11
void setup () {
Original file line number Diff line number Diff line change @@ -5,17 +5,20 @@ extern "C" {
5
5
int a = luaL_checkinteger (lua, 1 );
6
6
int b = luaL_checkinteger (lua, 2 );
7
7
pinMode (a, b);
8
+ return 0 ;
8
9
}
9
10
10
11
static int lua_wrapper_digitalWrite (lua_State *lua) {
11
12
int a = luaL_checkinteger (lua, 1 );
12
13
int b = luaL_checkinteger (lua, 2 );
13
14
digitalWrite (a, b);
15
+ return 0 ;
14
16
}
15
17
16
18
static int lua_wrapper_delay (lua_State *lua) {
17
19
int a = luaL_checkinteger (lua, 1 );
18
20
delay (a);
21
+ return 0 ;
19
22
}
20
23
21
24
static int lua_wrapper_print (lua_State *L) {
You can’t perform that action at this time.
0 commit comments