mirror of
git://projects.qi-hardware.com/nn-usb-fpga.git
synced 2025-01-10 00:00:14 +02:00
7d9b7b803c
Adding blinker demo: lua_blink_led
20 lines
409 B
C
20 lines
409 B
C
#include "lua.h"
|
|
#include "lualib.h"
|
|
#include "lauxlib.h"
|
|
#include <stdio.h>
|
|
|
|
|
|
static int myCfunc ( lua_State *L) {
|
|
printf ("lua SIE's test\n");
|
|
double trouble = lua_tonumber(L, 1);
|
|
lua_pushnumber(L, 16.0 - trouble);
|
|
return 1; }
|
|
|
|
|
|
int luaopen_luapassing ( lua_State *L) {
|
|
static const luaL_reg Map [] = {
|
|
{"dothis", myCfunc},
|
|
{NULL,NULL} } ;
|
|
luaL_register(L, "cstuff", Map);
|
|
return 1; }
|