WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: LUA + GPIO + OPENVG  (Read 2788 times)

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
LUA + GPIO + OPENVG
« on: September 09, 2015, 02:03:57 AM »
Been messing about using scripting languages to toggle GPIO pins.

Shell and Micropython work ok.
Lua is as nearly fast as Micropython, but Luajit is fastest.
Luajit has a  library ffi which I think can call c functions.

Did some googling and found I had been here before using Lua-periphery running on Raspbian
http://forum.tinycorelinux.net/index.php/topic,18088.msg109852.html#msg109852
Just need to figure out how to get it from Raspbian to piCore.

Found also a way of doing OpenVG with Luajit, User interfaces?
https://github.com/Wiladams/LJIT2RPi

With Luajit I think it might also be possible to interface to rpi-videocore.tcz

Lua + Luajit <500KB
gcc approx 30MB, plus Make, learning to Compile etc, one day but not this week/month.

Micropython calling rpi-videocore?

Luajit or Micropython look like interesting options for doing serious stuff without bloating the install size.



Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11519
Re: LUA + GPIO + OPENVG
« Reply #1 on: September 09, 2015, 02:25:56 AM »
Hi gavinmc42
Quote
Lua + Luajit <500KB
gcc approx 30MB, plus Make, learning to Compile etc, one day but not this week/month.
Once your C program is complete, that 30MB is no longer needed. Plus the C runtime library is part of the base install. While make
has its place, a simple script can also be used to compile/link.

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: LUA + GPIO + OPENVG
« Reply #2 on: September 09, 2015, 04:54:41 AM »
Yep but I'm behind a firewall without internet access for tcz's.
Still have to learn how to command line login to Uni internet system.
Uni login is via web page, so need piCore X win with browser.

Hard to install all the make, build, compile dependencies etc.
Everything is manual installed :'(

Will need to get Raspbian to compile but have to learn how to do it 1st.
Just got Ubuntu Mate PC box done so I can try cross compiling too.
Need to find time to setup piCore native compile box so I can make own tcz.
So many things still to do.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11028
Re: LUA + GPIO + OPENVG
« Reply #3 on: September 09, 2015, 05:42:50 AM »
You don't need to do it so difficultly, you already connect with a computer - share that connection. NAT through an existing computer will use that computer's authorization.
The only barriers that can stop you are the ones you create yourself.

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: LUA + GPIO + OPENVG
« Reply #4 on: September 09, 2015, 08:40:43 PM »
Univeristy PC running Win 7, internet sharing verboten :(
Shhh Ubuntu box has two network cards ;)
Uni guys not too bad, have two officially internet connection allowed Pi's.
Mainly used for updating my versions of Raspbian and Ubuntu Mate.

Real reason I use RPi's and piCore is to learn how to do Linux without a net.
Allows me to make low cost hardware instruments and gadgets.
Out in the field sometimes no net access.
Test hardware with scripting.
Been learning how to write the running software with zero or minimum library's.

Good practice for emerging IoT gadgets to learn how to do low memory footprint OS's
Using 30MB OS on 128MB SD card instead of 4GB on 8GB card.
Discovered how to do lots with just the Kernel, busybox and some scripts.
Ran up against shell scripts speed issues, hence the investigation into other languages like Micropython and Lua.