So my project is to use our beloved LÖVE using as Raspberry Pi and Retroppie, and for the moment it has been a success :-)
Now I'm trying to use the pins of the raspberry pi with the lua-periphery
I got the .zip file, extracted it next to my main.lua
then in my love.load() :
Code: Select all
local GPIO = require('periphery').GPIO
local gpio_out = GPIO("/dev/gpiochip0", 17, "out")
gpio_out:write(false)
gpio_out:close()
What I understand is that LÖVE don't find the module.Error
main.lua:5: module 'periphery' not found:
no field package.preload['periphery']
no 'periphery' in LOVE game directories.
no file 'periphery' in LOVE paths.
no file '.\periphery.lua'
no file 'C:\Program Files\Love\lua\periphery.lua'
no file 'C:\Program Files\Love\lua\periphery\init.lua'
no file '.\periphery.dll'
no file 'C:\Program Files\Love\periphery.dll'
no file 'C:\Program Files\Love\loadall.dll'
Traceback
[C]: in function 'require'
main.lua:5: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
I've seen this this bits on the github documentation but I don't really understand it, and don't know if I have something to do in Windows to make it work :
Any idea of what I should do ?Build and install from source
Clone lua-periphery recursively to also fetch c-periphery, which lua-periphery is built on.
$ git clone --recursive https://github.com/vsergeev/lua-periphery.git
$ cd lua-periphery
$ make clean all
$ cp periphery.so /path/to/lua/libs/
Place periphery.so in a directory searched by the Lua package.cpath variable. For example: /usr/lib/lua/5.3/, the same directory as other Lua sources, etc.
lua-periphery can then be loaded in lua with periphery = require('periphery').
Thanx !