lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I have played a little bit with my RPi once but i used C library using FFI (because i couldn't find decent Lua library, iirc)

local alien = require 'alien'
local pigpio = alien.load 'pigpio'

and then like:

local gpioRead = pigpio.gpioRead
gpioRead:types{"uint", ret ="int"}
-- ....
-- skip
-- ....
local function piSclkTick()
  gpioWrite(SCLK, HIGH)
  local read_bit = gpioRead(MOSI)
  gpioWrite(SCLK, LOW)
  return read_bit

etc etc
just read about how to usa FFI with Lua, and docs on pigpio library


On Sun, Dec 20, 2020 at 4:57 PM Foster Schucker <> wrote:
Because we are a much extended family, our Christmas comes early,
normally the week before.

One of my gifts this year was a huge selection of Breakout Garden kits
from Pimorni

I'd like to connect them to my Pi (the easy part) and then mess around
with Lua making things happen (the fun part)

But there is a fair amount of bit banging to get the I2C and SPI devices
to work.

Can you suggest a library that works with the Raspberry PI that you have

One of my goals is to incorporate devices like the RGB encoder or the
trackball into my Pico-8 or Love games.

Thanks for your ideas and Happy Holiday!